I'm looking for a solution to auto increment decimal value in a column until maximum value has reached for each column.
I have managed to make an formula for column A { =SUM(B3+0,1) }
By dragging down cell 1 to a maximum value that i require, however this is not very effective because each column has different maximum values.
As shown in diagram below:
Column A maximum required value 200
Column B maximum required value 400
Column C maximum required value 800
| A | B | C |
---------------------------------
#1 | 1,1 | 2,1 | 3,1 | -- mimimum value
#2 | 200 | 400 | 800 | -- maximum value
---------------------------------
#3 | 1,2 | 2,2 | 3,2 | -- incremented value minimum A$1 + 0,1 | B$1 +0,1 | C$1 + 0,1
#4 | 1,3 | 2,3 | 3,3 | -- incremented value minimum A$3 + 0,1 | B$3 +0,1 | C$3 + 0,1
#5 | 1,4 | 2,4 | 3,4 | -- incremented value minimum A$4 + 0,1 | B$4 +0,1 | C$4 + 0,1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ split
#13 | 2,2 | 3,2 | 4,2 | -- incremented value minimum A$12 + 0,1 | B$12 +0,1 | C$12+ 0,1
Some columns have > 600 rows count.
My question how would it be possible to populate each column with 0,1 decimal values with a VBA script or other Excel formula?
Sub AddValue()
Dim Rng As Range, A3 As Range
Set Rng = Range("A3:A99999")
For Each Al In Rng
A3.Value = A3.Value + 0,1
Next
End Sub
And how can i stop excel increment values when it has reached a certain value?
If i could populate each column by any means that give higher than the maximum value i could filter out values for each colomn with a custom filter "Show only values between x and xxx"
Changes
Update 1: I have updated the script in my post with a for-loop. However the 0,1 is not accepting and i need to increment cells below A2 untill the Mimimum value in (A1) has reached the Maximum value (A2)
Update 2: I'm now using a formula with a logic that returns FALSE when the maximum value has been triggered.
=IF(B2+0,1>B$1;FALSE;B2+0,1)
The question remains how do i populate rows with VBA for instance 'B3' to 'B99999' | 'C3' to 'C99999' | 'D4' to 'D99999' etc with this formula in every cell incremented. If thats solved i can trigger a filter to remove all rows which contain 'FALSE'