Forum Discussion
Anonymous
Dec 20, 2017X+1 +1 +1... till match a condition
Hi,
I have this table that needs to do a formula on:
J3 of J2+x till B3>=H3.
J4 of J3+x till B4>=H4.
J5 of J4+x till B5>=H5.
...
Is this possible without macros?
Anonymous
Dec 21, 2017Wow this works rly more faster than my macro xD
Thanks for the code, but my question is whether it is possible to do this without macros
Sub Botón1_Haga_clic_en()
Range("D4:D33").ClearContents
Do While Hoja1.Cells(4, 11) < Hoja1.Cells(4, 3)
Hoja1.Cells(4, 4) = Hoja1.Cells(4, 4) + 1
Loop
Do While Hoja1.Cells(5, 11) < Hoja1.Cells(5, 3)
Hoja1.Cells(5, 4) = Hoja1.Cells(5, 4) + 1
Loop
Do While Hoja1.Cells(6, 11) < Hoja1.Cells(6, 3)
Hoja1.Cells(6, 4) = Hoja1.Cells(6, 4) + 1
Loop
Do While Hoja1.Cells(7, 11) < Hoja1.Cells(7, 3)
Hoja1.Cells(7, 4) = Hoja1.Cells(7, 4) + 1
Loop
Do While Hoja1.Cells(8, 11) < Hoja1.Cells(8, 3)
Hoja1.Cells(8, 4) = Hoja1.Cells(8, 4) + 1
Loop
Do While Hoja1.Cells(9, 11) < Hoja1.Cells(9, 3)
Hoja1.Cells(9, 4) = Hoja1.Cells(9, 4) + 1
Loop
Do While Hoja1.Cells(10, 11) < Hoja1.Cells(10, 3)
Hoja1.Cells(10, 4) = Hoja1.Cells(10, 4) + 1
Loop
Do While Hoja1.Cells(11, 11) < Hoja1.Cells(11, 3)
Hoja1.Cells(11, 4) = Hoja1.Cells(11, 4) + 1
Loop
Do While Hoja1.Cells(12, 11) < Hoja1.Cells(12, 3)
Hoja1.Cells(12, 4) = Hoja1.Cells(12, 4) + 1
Loop
Do While Hoja1.Cells(13, 11) < Hoja1.Cells(13, 3)
Hoja1.Cells(13, 4) = Hoja1.Cells(13, 4) + 1
Loop
End Sub- Dec 23, 2017
Not without macros, no. For calculating an individual cell you can use Goal Seek in the Data > Analysis ribbon, but for many cells like your scenario, you will need VBA.