+ Reply to Thread
Results 1 to 2 of 2

Code wrong

  1. #1
    Forum Contributor
    Join Date
    04-21-2006
    Location
    Australia
    MS-Off Ver
    O365 PC Version 2301
    Posts
    122

    Code wrong

    Just need help correcting this code. I think it is obvious what I am trying to achieve but have worded it wrongly. Trying to set the file to open on a sheet that is selected on a cell. The two extra criteria would otherwise cause errors so defaults to Manager Page in either case.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267
    Hey,

    Take a look at this

    Private Sub Workbook_Open()
    Lara = Worksheets("settings").Range("g8")
    If Lara = "click to select choice here" Then Lara = "Manager Page"
    If Lara = "" Then Lara = "Manager Page"
    ThisWorkbook.Sheets(Lara).Activate
    End Sub

    Vba did not like 'default' as a name, so i always use names of people i know
    so it wont match something vba already uses.


    Hope it helps
    JR
    Versions
    Mac OS X 'Leopard'
    Mac MS Office Excel 2004
    Windows XP
    MS Excel 2002
    MS Excel 2003

+ 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