+ Reply to Thread
Results 1 to 2 of 2

Restarting from initial value in a loop

  1. #1
    Registered User
    Join Date
    07-06-2011
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    20

    Question Restarting from initial value in a loop

    I have a looping macro that consists of this line.

    Please Login or Register  to view this content.
    I think the error is coming because even when g>h, the g value is still gonna be inputed as that higher value because that is what VBA is reading it as.

    I want the code to go back to the initial g value. Is there a way of doing this?

    For example, something like.

    Please Login or Register  to view this content.

    Thanks for the help.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Restarting from initial value in a loop

    Do you mean you want K1 to contain the first value of g greater than h? If so, just end the loop afterwards:
    Please Login or Register  to view this content.

+ 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