I am trying to automate a process that we run daily at work, and I am having some trouble pasting formulas based on a value in another column.
For Category A and B, I need to paste two separate formulas. Here is the code that I currently have. It works when I do the record macro function, but it does not work when run through VBA.
I choose row 21 because it is a fixed cell, and I can paste into it easily. I was then trying to fill down, and then I would replace the contents of row 21.
It does not appear to be filling the formulas down.
Any help would be great with this? I have scoured Google, and I have not found anything that helps.
For Category A and B, I need to paste two separate formulas. Here is the code that I currently have. It works when I do the record macro function, but it does not work when run through VBA.
I choose row 21 because it is a fixed cell, and I can paste into it easily. I was then trying to fill down, and then I would replace the contents of row 21.
Code:
'Paste Category Formulas In Category A
Range("HL21:HW21").Select
Selection.Copy
Windows("Things that make it work.xls").Activate
Range("A10").Select
ActiveSheet.Paste
Windows("Wall Plan.xls").Activate
Selection.AutoFilter Field:=239, Criteria1:="a"
Range("HL3:HW3").Select
Selection.Copy
Range("HL21").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("HL21:HW21").Select
Selection.FillDown
'Paste Category Formulas In Category B
Selection.AutoFilter Field:=239, Criteria1:="b"
Range("HL4:HW4").Select
Selection.Copy
Range("HL21").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("HL21:HW21").Select
Selection.FillDown
Windows("Things that make it work.xls").Activate
Range("A10:L10").Select
Selection.Copy
Windows("Wall Plan.xls").Activate
Range("HL21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Calc Sheet
It does not appear to be filling the formulas down.
Any help would be great with this? I have scoured Google, and I have not found anything that helps.