Hello,
I have thebelow code that will find the last row of data and will add a formulaafterwards. It was working a few minutes ago. I made an update to it andremoved it and now it’s not working. I am not getting an error message. Themacro runs all the way through and does nothing.
What am I missing?
Thank you
I have thebelow code that will find the last row of data and will add a formulaafterwards. It was working a few minutes ago. I made an update to it andremoved it and now it’s not working. I am not getting an error message. Themacro runs all the way through and does nothing.
What am I missing?
Rich (BB code):
SubWatchlistTable()
'
'WatchlistTable Macro
'
Dim lRow AsLong
Dim lRow2 AsLong
Dim LR As Long
‘Find last rowof data in Table
LR =Range("AY" & Rows.Count).End(xlUp).Row
‘Find last rowof data in Pivot Table
lRow =Range("BS" & Rows.Count).End(xlUp).Row
‘Find last row ofdata in table and add formula after last row of data
Range("AY"& LR + 1).FormulaR1C1 ="=IF(R[-1]C[16]=""(blank)"",""TBD"",R[-1]C[16])"
Range("AZ"& LR + 1).FormulaR1C1 = "=R[-1]C[16]&"" /""&R[-1]C[19]"
Range("BA"& LR + 1).FormulaR1C1 = "=IF(R[-1]C[23]=""(blank)"",R[-1]C[16],R[-1]C[23])"
Range("BB"& LR + 1).FormulaR1C1 = "=""Published on""&TEXT(R[-1]C[18],""mm/dd/yyyy"")&""with ""&R[-1]C[20]&"" rating and""&R[-1]C[21]& ""issues:"""
Range("BC"& LR + 1).FormulaR1C1 = "=R[-1]C[18]"
‘Copy formuladown to last data in pivot table
Range("AY5:BC" & LR).Copy Range("AY5" &lRow)
Application.CutCopyMode = False
End Sub
Thank you