VBA Help

keyboard1960

New Member
Joined
Aug 28, 2002
Messages
7
Trying to write code that would check a single column for data starting at the top and then subtract that cell's values with the next cell with data that it finds further down the column. Let me know if this doesn't make any sense. Thanks, Byron
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

keyboard1960

New Member
Joined
Aug 28, 2002
Messages
7
In column "K" if conditions are matched we would have data in a cell such as Column K Row 30 the data would be 650. Then another cell further down the column might also have data such as Column K Row 40 data value 900. In column "L" I would like to search automatically for all data in column K and subtract as in this example K30-K40. Hope this clarifys. Thanks in advance.
 

Rylandir

New Member
Joined
Feb 18, 2002
Messages
24
If ...

A1=10
A2=(blank)
A3=30
A4=100
A5=(blank)
and so on ...

Given that example, are you wanting a formula in B1 that = A1-A2-A3-A4-A5 (the blanks would evaluate to subtracting a zero)?
 

keyboard1960

New Member
Joined
Aug 28, 2002
Messages
7
I'm sorry in my 2nd post I should have listed as the example K40-K30. Then the next cell to be computed would be let's say K50-K40. You can see why I'm going nuts. I guess this would require some coding that would read ahead for the next entry in a column and subtract that entry from the previous one. Thanks for your help.
 

Forum statistics

Threads
1,147,665
Messages
5,742,502
Members
423,734
Latest member
123hmMission

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
Top