Consulting

Results 1 to 3 of 3

Thread: Retrieving specifc cell value for loop

  1. #1
    VBAX Regular
    Joined
    Jul 2010
    Posts
    15
    Location

    Question Retrieving specifc cell value for loop

    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
    [VBA]
    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
    [/VBA]

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    [vba]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 [/vba]
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Regular
    Joined
    Jul 2010
    Posts
    15
    Location
    It worked!

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •