Tucker2008
New Member
- Joined
- Aug 19, 2013
- Messages
- 37
- Office Version
- 2013
- Platform
- Windows
Hello,
How do I Sum each column in a range in VBA (I want the sum formula to be Last Row +1)...this code works perfectly for a single Column....but I cannot figure out the range:
'6.) Find the bottom row and sum
Sheets("Data2").Select
LastRow = Range("A2").Select
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("AY" & LR + 1).Formula = "=SUM(AY2:AY" & LR & ")"
Any help would be appreciated.
TM
How do I Sum each column in a range in VBA (I want the sum formula to be Last Row +1)...this code works perfectly for a single Column....but I cannot figure out the range:
'6.) Find the bottom row and sum
Sheets("Data2").Select
LastRow = Range("A2").Select
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("AY" & LR + 1).Formula = "=SUM(AY2:AY" & LR & ")"
Any help would be appreciated.
TM