Macro to fill in a number of cells based on a specific value

MaxTiger

New Member
Joined
Nov 19, 2018
Messages
4
Hi all,


I am looking for a macro that can fill in a number of cells based on a specific value. For instance, a row is populated with 0's & 1's from lets say column A to N which cumalatives to 8. I want to extend this row until column Z by adding "X" to reach a cummulative of 17. That means that (without changing the values from A to N), there are 12 remaning cells until column Z is reached, to to add 9 to the cummulative. However, I want these values to be spread evenly accros the remaining 12 cells, and only integer.


This spread must be with the following patern, rounding up to the closest whole number returns a 1 or a 0:
0.75
1.5
2.25
3
3.75
4.5
5.25
6
6.75
7.5
8.25
9
1
1
0
1
1
1
0
1
1
1
0
1

<tbody>
</tbody>


For each set from A to Z I wan to do the same. The next set AA to AZ has no values yet, because as stated before, only cells in columns A to N were populated. Again, i want to be able to insert an "X value" that would determine the spread and cumulative of that 'set'.


So finally you would have the possibility to insert an X for A to Z, AA to AZ, BA to BZ and so on.
I am not sure if this is even posible with macros or formulas, but I hope one of you could give me a solution to this!
 

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.
With a blank column at left,

A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
L​
M​
N​
1​
0.75​
1.5​
2.25​
3​
3.75​
4.5​
5.25​
6​
6.75​
7.5​
8.25​
9​
2​
1​
1​
0​
1​
1​
1​
0​
1​
1​
1​
0​
1​
B2: =ROUND(B1, 0) - SUM($A2:A2)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

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