J
Juan Correa
Hello,
I have the following piece of code (taken from having recorded the
particular steps into a macro).
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/28/2009 by Juan S. Correa
'
'
Range("AD2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-18],REGION,2,FALSE)"
Range("AD2").Select
Selection.AutoFill Destination:=Range("AD2:AD4513")
End Sub
The code will add the VLOOKUP formula in cell AD2 of my spreadsheet and then
will copy/paste that formula down all the way down to AD4513. That would be
OK if the amount of data comming into the spreadsheet were constant, but some
it varies every month so defining the range as ("AD2:AD4513") is not
practical in my particular case.
What I'm looking for is a way for Excel to copy/paste the formula all the
way down to the last populated row regardless of how many rows of data there
are on the spreadsheet.
Thanks in advance,
Juan Correa
I have the following piece of code (taken from having recorded the
particular steps into a macro).
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/28/2009 by Juan S. Correa
'
'
Range("AD2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-18],REGION,2,FALSE)"
Range("AD2").Select
Selection.AutoFill Destination:=Range("AD2:AD4513")
End Sub
The code will add the VLOOKUP formula in cell AD2 of my spreadsheet and then
will copy/paste that formula down all the way down to AD4513. That would be
OK if the amount of data comming into the spreadsheet were constant, but some
it varies every month so defining the range as ("AD2:AD4513") is not
practical in my particular case.
What I'm looking for is a way for Excel to copy/paste the formula all the
way down to the last populated row regardless of how many rows of data there
are on the spreadsheet.
Thanks in advance,
Juan Correa