I'm a noobie and am having trouble understanding what is going on with this macro.
Sub CopyMultidayTimeIntervalFormula()
n = ActiveCell.Row
Set r1 = Range("AS2" & n & ":EJ2" & n)
Set r2 = Range("AS" & n + 1)
r1.Copy
r2.PasteSpecial Paste:=xlPasteFormulas
End Sub
I am trying to do the following:
- Copy the formula I have in the range AS2:EJ2 and paste it into any other rows that meet my criteria.
When I run this macro it doesn't do anything except highlight the cells in the row below my active cell, which I believe comes from the Set r2 = Range("AS" & n + 1). Can VBA copy a formula and then paste it, or do you have to write the formula to it run?
Any help or pointers?
Example Workbook.xlsm
Bookmarks