carter2023
New Member
- Joined
- Jul 5, 2022
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Hi,
I am trying to autofill a formula down the the last row of a pivot table. Pivot table is in column b and starts in cell B11 and I am trying to autofill a code in column D starting with cell D11. This is the code I currently have:
Range("D11").Select
ActiveCell.Formula = "=IF(RIGHT(B11,5)=$D$1,$D$1,$D$2)"
Dim LR As Long
'LR means Last Row'
LR = Cells(Rows.Count, 2).End(xlUp).Row
Range("D11").AutoFill Range("D11:LR")
I am trying to autofill a formula down the the last row of a pivot table. Pivot table is in column b and starts in cell B11 and I am trying to autofill a code in column D starting with cell D11. This is the code I currently have:
Range("D11").Select
ActiveCell.Formula = "=IF(RIGHT(B11,5)=$D$1,$D$1,$D$2)"
Dim LR As Long
'LR means Last Row'
LR = Cells(Rows.Count, 2).End(xlUp).Row
Range("D11").AutoFill Range("D11:LR")