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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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.
 
Upvote 0
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)?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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