How to Sum Range VBA depending on fill down
i want to sum fill down range depending on Last Row that can be vary next time .
Suppose i have data in range ("A1:A5").
what i want is to fill down "=A2*2" in B1 to last row & below 1 blank row i want to sum that range in B7 .
this is my sample code
Any help would be appreciated
Dim LastRow As Long
LastRow = Range("A" & Cells.Rows.Count).End(xlUp).Row
Range("B1:B" & LastRow).Formula = "=A1*2"
LastRow = Range("A" & Cells.Rows.Count).End(xlUp).Row + 2
Range("B" & LastRow).Select
Range("B" & LastRow).Formula = "Sum("B1:B" & Lastrow)"
Keys to the Problem How to Sum Range VBA depending on fill down
Dim LastRow As Long
LastRow = Range("A60000").end(xlup).row
Range("B1").Formula = "=A1*2"
Range("B1:B" & lastrow).filldown
Range("B" & LastRow+2).Formula = "=Sum(B1:B" & Lastrow & ")"
Hope this helps.
In this method we will try to Boot in Safe mode with Networking and see if the error still persists.
- Search "MSCONFIG" and Open.
- Click on Boot Tab
- Tick Safe Boot in Boot Option
- Select Network.
- Click Apply and OK.
- Reboot your System.
Recommended Method to Fix the Problem: How to Sum Range VBA depending on fill down:
How to Fix How to Sum Range VBA depending on fill down with SmartPCFixer?
1. Click the button to download Error Fixer . Install it on your system. Open it, and it will perform a scan for your computer. The errors will be shown in the scan result.
2. After the scan is finished, you can see the errors and problems need to be repaired. Click Fix All.
3. When the Fixing part is finished, your computer has been speeded up and the errors have been removed
Related: Cannot associate msg format with Outlook 2013 in Windows 8 realtek audio driver windows 7 How do I move messages from Windows Mail Inbox back to the Verizon Inbox realtek pcie fe family controller driver Interactive Services detection window error Program Path C Windows SysWOW64 cmd exe realtek high definition audio driver Since I upgraded to Windows 7 everytime I start my computer I have to reset my LAN connection for the internet to work Are there any updates or service packs that will fix this Thanks realtek drivers Standby performance issues on Windows 7 laptop realtek drivers download Windows msi installer notepad realtek pcie fe family controller driver Windows xp keeps restarting with blue screen after windows logo then restarts realtek audio drivers two Refer for the user’s manual that came with your ASUS motherboard or laptop for descriptions and explanations about the numerous BIOS settings.,Active Window Becomes Inactive,'Address A Problem With Flash Loader Utility',Abnormal Program Termination,Additional Highlighting Colours In 2007,Apps And Programs Not Opening