Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie. Please help me find a loop solution
I am trying to calculate a value for a cell and at the same time store
the previous cell value for the next calculation. The following code works, but I need to find a way to loop this until column AN and row 3000. I know there must be a better solution than how my code works and would be very greatful if someone can point me in the right direction. Sub test() Dim temp As Single Dim temp2 As Single temp = Range("m2").Value Range("m2").Value = Range("j2").Value - temp temp2 = Range("n2").Value Range("n2").Value = temp - temp2 temp = Range("o2").Value Range("o2").Value = temp2 - temp temp2 = Range("p2").Value Range("p2").Value = temp2 - temp End Sub I know there must be a better solution than how my code works and would be very greatful if someone can point me in the right direction. Nigel Brown |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Getting #DIV/O. Can't find a solution | Excel Discussion (Misc queries) | |||
sum if problem, trying to find best solution | Excel Discussion (Misc queries) | |||
please find a solution | Excel Discussion (Misc queries) | |||
VBA Newbie: Help with Do Loop code | Excel Discussion (Misc queries) |