Loop through a range, then "find" in another range

Secret Chimpanzee

Board Regular
Joined
Jun 21, 2012
Messages
141
Hi,

It's been a few years since I've done any vba coding and I can no longer stitch together small codes by searching for answers across different forums - so I'm hoping someone will be able to help me with the entire code...

What I need is:

1) In row 4, if the value in the first month being April (column E) is less than zero, then
2) Take that value and distribute it as an ABSOLUTE value across all the "New Capacity" rows from row 8 onwards, but using the following criteria:
a) "New Capacity" row must also have "Voice" in column B
b) Value in Column E must be greater than zero
c) Using the distribution splits of the cells that meet the criteria
3) Then it needs to do the same thing in reverse and subtract from the "New Capacity" cells that are less than zero and do this for all the months

The purpose is to have all the "New Capacity" rows as balanced as possible so that they are all showing a value either less than or greater than zero (think of it as distributing wealth)

I can't really do this in excel as it would return a circular reference and to do it manually for all months would take quite some time. I have tried to make the request as simple as possible so apologies if there is any detail lacking.
Picture1.png


Thanks,
Secret Chimpanzee
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

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