+ Reply to Thread
Results 1 to 4 of 4

Using Next or GoTo or Case Select?

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Using Next or GoTo or Case Select?

    I am checking to see if the value in column B is greater than the value of Column C. If the cell is empty, then I want the macro to skip to the next cell in the loop. When I write "next i" it errors "next without for". I know there are options to use GoTo or Case Select, but I couldn't get the syntax right on that either. Any suggestions?


    Please Login or Register  to view this content.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,375

    Re: Using Next or GoTo or Case Select?

    Hi,

    Is this what you want?
    Please Login or Register  to view this content.
    I think your error was you need a "For" for each "Next". You had two "Next" and only one "For". It is just the same as needing the same number of "(" as ")" in a formula or function.
    Last edited by MarvinP; 12-05-2012 at 06:16 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Using Next or GoTo or Case Select?

    Okay cool. I didn't see a need to add another For. It looks like your GoTo solution is what I need. I was missing the ":" when I was trying that possibility before. I'll apply your solution tomorrow thanks.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Using Next or GoTo or Case Select?

    ...or

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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