+ Reply to Thread
Results 1 to 6 of 6

Something like Goto

  1. #1
    Registered User
    Join Date
    06-30-2007
    Posts
    5

    Something like Goto

    Hello everybody.

    Is there a similar function to goto in VBA? I would like to jump back again in the code without using an if/else condition.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Something like

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    06-30-2007
    Posts
    5
    Can I jump with this codesnippet?

    Example:

    Please Login or Register  to view this content.
    In this example the code would jump always back to MARK if the IF statement is executed. It is an endless loop. Just a demo what I mean with goto.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Where's the loop. Not a good example

    Best way is try it and see or post some proper code with a proper example

    VBA Noob

  5. #5
    Registered User
    Join Date
    06-30-2007
    Posts
    5
    Quote Originally Posted by VBA Noob
    Where's the loop. Not a good example

    Best way is try it and see or post some proper code with a proper example
    The goto jump is the loop . Take a look at http://en.wikipedia.org/wiki/GOTO.

    Nevermind, I solved the problem using a normal Do While Loop Statement.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    VBA has a GoTo statement. The help system lists the syntax involved.

    "Best Practice" is to use GoTo only for error handeling.
    Last edited by mikerickson; 06-30-2007 at 06:14 PM.

+ 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