PDA

View Full Version : Retrieving specifc cell value for loop



dpatel
03-10-2011, 04:14 AM
Hello guys,

How can i retrieve specific cell value and loop through.
Ex. Row A1 has got value “3” (this value will be various)
So I would like to put A1 value into the loop. Hope someone will manage to assist me.

Thanks

Set tst = Activesheet.Cells(1,”A”).getValue???
For I = 1 to tst -1
Msgbox(i) ‘this should pop up like 3,2,1
Next I

p45cal
03-10-2011, 04:26 AM
tst = Activesheet.Cells(1,”A”).Value
For I = tst to 1 step -1
Msgbox I ‘this should pop up Like 3,2,1
Next I

dpatel
03-10-2011, 06:54 AM
It worked!

Thanks