VBA Help With Running Total & Moving Rows

George N

New Member
Joined
Jun 1, 2023
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hello all!

I am pretty much brand new to VBA and have ran into a roadblock on the project I am working on. I have made it to my last step here which is to restructure my running total. Essentially what I want to do is when the running total becomes negative, bring in the next row with a "P" as the type, and then re-run the running total and repeat the process until there are no negatives left. I currently have it set up how it looks in the attached before picture, and the after picture is my desired result. I have had to fully transform and edit the document to get it to this point so my code is all over the place, but I would be more than happy to post parts of it if needed.

I know I am not giving a lot to work with here but any help would be greatly appreciated!

Thank you!
 

Attachments

  • After.PNG
    After.PNG
    15.1 KB · Views: 5
  • Before.PNG
    Before.PNG
    15.5 KB · Views: 4

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,215,201
Messages
6,123,621
Members
449,109
Latest member
Sebas8956

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top