# Need to Run 3 Loop in a single sheet macro

Closed
senthil - Mar 15, 2010 at 02:06 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 15, 2010 at 02:11 PM
Hello,

I can able to run my requirment by 2 macro, i need to run in a single macro.

How to calculate this in single macro?

Ex.

A1 B1 C1 E1 F5 G1

S.No Due date Current Date A3-A2 Aging Bucket "1"

Coding i have for A4
-------------------------

Dim x As Integer

' Set numrows = number of rows of data.
NumRows = Range("A2", Range("A2").End(xlDown)).Rows.Count

Range("E1").Select

' Establish "For" loop to loop "numrows" number of times.
For x = 1 To NumRows
' Selects cell down 1 row from active cell.

ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"

Next
End Sub
------------------------------------------------------------------------------------

Coding for A5
'Sub TEXT2()

'Dim Y As Integer

' Set numrows = number of rows of data.
'NumRows = Range("A2", Range("A2").End(YlDown)).Rows.Count

' Select cell WHICH COLOUMN YOU NEED TO PRINT OUTPUT a1.
' Range("G1").Select

' Establish "For" loop to loop "numrows" number of times.
For Y = 1 To NumRows
' Selects cell down 1 row from active cell.

ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = _
=IF(RC[-1]<=5,""BELLOW 5 DAYS"",IF(AND(RC[-1]>5,RC[-1]<10),""5 TO 10 DAYS"",IF(AND(RC[-1]>10,RC[-1]<101),""10 TO 100 DAYS"",IF(RC[-1]>100,""ABOUE 100"",0))))"

Next

End Sub

---------------------------------------------------------------------------------------------------------
Related:

## 1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 15, 2010 at 02:11 PM
Well why cant you call both macro in third

sub combo()
call macro1
call macro2

end sub

Am I missing some thing here?