JRedRocker
New Member
- Joined
- Nov 4, 2012
- Messages
- 2
I am brand new to VBA. Just started recording macros and trying to modify them to work for my purposes.
I am trying to get the following code to reference the previous sheet dynamically rather than the sheet I selected when recording the macro (Oct 31) then autofilling to the end of the data.
LastRow = Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
Range("U2:U" & LastRow).FormulaR1C1 = "=VLOOKUP(RC[-16],'Oct 31'!C[-16]:C[1],17,FALSE)"
I found another thread that said to use activesheet.previous.select but I can't seem to replace 'Oct 31' with that code to make it work.
Suggestions please?
I am trying to get the following code to reference the previous sheet dynamically rather than the sheet I selected when recording the macro (Oct 31) then autofilling to the end of the data.
LastRow = Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
Range("U2:U" & LastRow).FormulaR1C1 = "=VLOOKUP(RC[-16],'Oct 31'!C[-16]:C[1],17,FALSE)"
I found another thread that said to use activesheet.previous.select but I can't seem to replace 'Oct 31' with that code to make it work.
Suggestions please?