samilynn
Board Regular
- Joined
- Jun 24, 2003
- Messages
- 166
- Office Version
- 2016
- Platform
- Windows
I am using this code within a macro, to autofill until the end of the range.
It works, but I can't get it to run if I want to use it on multiple columns (i.e: Columns M, R, and T).
Help, please?
thank you!
Samantha
Dim rngData As Range, rngFormula As Range
With ActiveSheet
Set rngData = .Range("A2:A" & .Cells(.Rows.Count, "A").End(xlUp).Row)
Set rngFormula = .Range("M2")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))
It works, but I can't get it to run if I want to use it on multiple columns (i.e: Columns M, R, and T).
Help, please?
thank you!
Samantha
Dim rngData As Range, rngFormula As Range
With ActiveSheet
Set rngData = .Range("A2:A" & .Cells(.Rows.Count, "A").End(xlUp).Row)
Set rngFormula = .Range("M2")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))