I am new to VBA.
The last lines of the recorded macro shown below show an absolute reference for a Fill Down operation (C448). I would like to make the reference dynamic - filling to the last row in the sheet rather than the fixed reference.
How should I modify this macro to do this?
Thank you ...
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000 ; background-color: #ffffff }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008f00 ; background-color: #ffffff }p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; background-color: #ffffff ; min-height: 13.0px}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #011993 ; background-color: #ffffff }span.s1 {color: #011993 }span.s2 {color: #000000 }</style>Sub Macro3()
'
' Macro3 Macro
' Prepares Daily Activity Report for import into FMP. Creates copy of original data, deletes unnecessary columns, adds calc for unique ID.
'
'
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Original Data"
Sheets("Original Data").Select
Sheets("Original Data").Copy Before:=Sheets(1)
Sheets("Original Data (2)").Select
Sheets("Original Data (2)").Name = "Edit for Import"
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C1").Select
ActiveCell.FormulaR1C1 = "ID Activity"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]&""-""&RC[-1]"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C448")
Range("C2:C448").Select
End Sub
The last lines of the recorded macro shown below show an absolute reference for a Fill Down operation (C448). I would like to make the reference dynamic - filling to the last row in the sheet rather than the fixed reference.
How should I modify this macro to do this?
Thank you ...
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000 ; background-color: #ffffff }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008f00 ; background-color: #ffffff }p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; background-color: #ffffff ; min-height: 13.0px}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #011993 ; background-color: #ffffff }span.s1 {color: #011993 }span.s2 {color: #000000 }</style>Sub Macro3()
'
' Macro3 Macro
' Prepares Daily Activity Report for import into FMP. Creates copy of original data, deletes unnecessary columns, adds calc for unique ID.
'
'
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Original Data"
Sheets("Original Data").Select
Sheets("Original Data").Copy Before:=Sheets(1)
Sheets("Original Data (2)").Select
Sheets("Original Data (2)").Name = "Edit for Import"
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C1").Select
ActiveCell.FormulaR1C1 = "ID Activity"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]&""-""&RC[-1]"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C448")
Range("C2:C448").Select
End Sub