What is wrong
Results 1 to 8 of 8

Thread: What is wrong
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    May 2019
    Posts
    62
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default What is wrong

    Application.Worksheets("Sheet5").DisplayFullScreen = True
    keep getting subscript out of range error
    plz help

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    25,439
    Post Thanks / Like
    Mentioned
    443 Post(s)
    Tagged
    45 Thread(s)

    Default Re: What is wrong

    How about
    Code:
    Application.DisplayFullScreen = True
    - 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
    May 2019
    Posts
    62
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is wrong

    ty , but i need an specific worksheet to open not the active one.

  4. #4
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,027
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    11 Thread(s)

    Default Re: What is wrong

    Just select that sheet first, i.e.
    Code:
    Sheets("Sheet5").Activate
    Application.DisplayFullScreen = True
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  5. #5
    Board Regular
    Join Date
    May 2019
    Posts
    62
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is wrong

    Tried it but got nowhere here is my complete code.....it is in a form if that make a difference

    tyvm


    Private Sub commandButton1_Click()
    Sheets("Sheet5").Activate
    Application.DisplayFullScreen = True
    Application.CommandBars("Full Screen").Visible = False
    'Range("C2").Select
    Range("C2").ClearContents
    Range("n2").ClearContents
    Range("b5").ClearContents
    Range("c3").ClearContents
    Range("a6:a460").ClearContents
    ' Range("C2").Select
    Me.Hide







    End Sub

  6. #6
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,027
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    11 Thread(s)

    Default Re: What is wrong

    What is it exactly that you are trying to accomplish?
    I seldom work with Forms (I find them rather cumbersome in Excel, and prefer to use Access if I need Forms), but try putting those two lines AFTER the "Me.Hide" line.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  7. #7
    Board Regular
    Join Date
    May 2019
    Posts
    62
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What is wrong

    ty got it
    and yes i am learning that excel forms aren't real friendly!!!

  8. #8
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,027
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    11 Thread(s)

    Default Re: What is wrong

    You are welcome.

    I just find them a bit cumbersome to work with, as you need to explicitly link them to Excel using VBA. In Access, form fields can automatically be "bound" to table and query fields (no need to manually map them).
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

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
  •