VBA to sum up cell values in each matching row until it is >= 480 then reference the specific row in the data that brought the sum to be >=48

archangel7101

New Member
Joined
Jul 21, 2022
Messages
1
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2011
  5. 2010
  6. 2007
Platform
  1. Windows
Is it possible to use excel vba to go thru a sheet of data and and start adding up the values that match the specific criteria until the sum value is >= 480, then be able to reference the specific row of data that brought the sum value to be >= 480 and pull the cell value from Column B of that row. Basically, the macro would pull the criteria out of a row in another sheet (Sheet2), a badge number and a start date, and add up the values in Column E where the badge number matches and the charge date is >= the start date. When sum value of rows that match that criteria is >= 480, I need the macro to pull charge date from the exact row that raised the sum value to be >= 480 and paste the cell value into a specific column in the row where the criteria was pulled in Sheet2. Then the macro would need to go to the next row in Sheet2 and repeat the process.
 

Attachments

  • PPL Data Screencap.PNG
    PPL Data Screencap.PNG
    10.8 KB · Views: 21

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,921
Messages
6,122,280
Members
449,075
Latest member
staticfluids

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