Results 1 to 7 of 7

Thread: Elseif issue
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Dec 2016
    Posts
    214
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Elseif issue

    Not sure why this gets an error. It seems pretty simple.

    Error occurs at the ElseIf "Application.GoTo ActiveWorkbook.Sheets("Scores").Cells(3, 1)" line

    I replaced it with the App GoTo line above and if functions as it should, so its not liking the "Scores" name. Spelling correct, same workbook etc.

    ideas???



    Private Sub CommandButton1_Click() ' Main Page
    If OBEntry.Value = True Then
    Unload UserForm11
    Application.GoTo ActiveWorkbook.Sheets("Entries").Cells(3, 1)


    ElseIf OBScoring.Value = True Then
    Unload UserForm11
    Application.GoTo ActiveWorkbook.Sheets("Scores").Cells(3, 1)

    Else
    Unload UserForm11
    UserForm12.Show

    End If
    End Sub


  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,044
    Post Thanks / Like
    Mentioned
    467 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Elseif issue

    What error do you get?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    Dec 2016
    Posts
    214
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Elseif issue

    Method "goto of object" application failed

  4. #4
    Board Regular
    Join Date
    Dec 2016
    Posts
    214
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Elseif issue

    If I use this code it functions fine, but I would like to know what rule I broke with the above code.


    ThisWorkbook.Sheets("Scores").Activate

  5. #5
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,044
    Post Thanks / Like
    Mentioned
    467 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Elseif issue

    Is the "Scores" sheet protected?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  6. #6
    Board Regular
    Join Date
    Dec 2016
    Posts
    214
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Elseif issue

    yes!

  7. #7
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,044
    Post Thanks / Like
    Mentioned
    467 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Elseif issue

    Then you either have to unprotect it, select as unlocked cell, or use a different method.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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