+ Reply to Thread
Results 1 to 2 of 2

Do loops

  1. #1
    Registered User
    Join Date
    10-20-2005
    Posts
    11

    Do loops

    Hi,
    Is it possible to call show the value of the first, second, third or forth iteration of a do loop, and continue with the iterations to still get an end value?This is to give me some idea of what the do loop is doing...

    Also, say my function is called jeff(....) can I change the value of it according to what cell the function is showing in? For example,

    if cell=A2 then
    jeff = ....
    end if
    ?

    Any help would be great

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    It's pretty uncouth, but a variation of

    Dim ctr, ctr1, ctr2, ctr3, ctr4 As Integer
    ctr = 1
    For ctr1 = 1 To 4
    For ctr2 = 5 To 7
    For ctr3 = 10 To 13
    For ctr4 = 20 To 30
    Range("AA" & ctr).Value = " 1 = " & ctr1 & " 2 = " & ctr2 & " 3 = " & ctr3 & " 4 = " & ctr4
    ctr = ctr + 1
    Next
    Next
    Next
    Next


    should leave a trail in column AA for you, up to 65536 items before an error


    Quote Originally Posted by grandfilth
    Hi,
    Is it possible to call show the value of the first, second, third or forth iteration of a do loop, and continue with the iterations to still get an end value?This is to give me some idea of what the do loop is doing...

    Also, say my function is called jeff(....) can I change the value of it according to what cell the function is showing in? For example,

    if cell=A2 then
    jeff = ....
    end if
    ?

    Any help would be great

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1