[MENTION]Hi newbie to VBA here,
I am trying to create a macro that takes a formula created in Cell G3 drags it to M3, and then auto fills to the bottom of the last row. The way I was working on it was previously recording and making some adjustments, I cannot find a way to have it auto fill to the last row of the data. Data set rows change frequently, this is what I have so far. (Note you can ignore the G2 portion - that is for a separate autofill part of the Macro)
Range("G2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[-6]"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:M2"), Type:=xlFillDefault
Range("G2:M2").Select
Range("G3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]="""",R[-1]C,RC[-6])"
Range("G3").Select
Selection.AutoFill Destination:=Range("G3:M3"), Type:=xlFillDefault
Range("G3:M3").Select
Selection.AutoFill Destination:=Range("G3:M67")
Range("G3:M67").Select
Range("A1:V67").Select
Range("G3").Activate
Thank you for any help![/MENTION]
I am trying to create a macro that takes a formula created in Cell G3 drags it to M3, and then auto fills to the bottom of the last row. The way I was working on it was previously recording and making some adjustments, I cannot find a way to have it auto fill to the last row of the data. Data set rows change frequently, this is what I have so far. (Note you can ignore the G2 portion - that is for a separate autofill part of the Macro)
Range("G2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[-6]"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:M2"), Type:=xlFillDefault
Range("G2:M2").Select
Range("G3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]="""",R[-1]C,RC[-6])"
Range("G3").Select
Selection.AutoFill Destination:=Range("G3:M3"), Type:=xlFillDefault
Range("G3:M3").Select
Selection.AutoFill Destination:=Range("G3:M67")
Range("G3:M67").Select
Range("A1:V67").Select
Range("G3").Activate
Thank you for any help![/MENTION]