+ Reply to Thread
Results 1 to 2 of 2

else without if

Hybrid View

dabrows else without if 09-14-2011, 03:20 PM
TMS Re: else without if 09-14-2011, 03:26 PM
  1. #1
    Registered User
    Join Date
    02-11-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    98

    else without if

    found at the 1st else statement. sorry about the my extreme noobness

    appreciate any help at all

    If Cells(6, 18) = 0 Then Cells(4, 20).Select
    
        Else
            If Cells(6, 18) = 5 Then Cells(5, 20).Select
    
              Else
                If Cells(6, 18) = 10 Then Cells(6, 20).Select
    
                   Else
                    If Cells(6, 18) = 15 Then Cells(7, 20).Select
    Last edited by dabrows; 09-14-2011 at 03:29 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,439

    Re: else without if

    Try:

    If Cells(6, 18) = 0 Then
        Cells(4, 20).Select
    Else
        If Cells(6, 18) = 5 Then
            Cells(5, 20).Select
        Else
            If Cells(6, 18) = 10 Then
                Cells(6, 20).Select
            Else
                If Cells(6, 18) = 15 Then
                    Cells(7, 20).Select
                End If
            End If
        End If
    End If

    But you should avoid the Selects

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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