+ Reply to Thread
Results 1 to 3 of 3

Syntax of hide/unhide personal.xls toggle

  1. #1
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    Syntax of hide/unhide personal.xls toggle

    Help! In trying to come up with a macro to toggle the Personal.xls workbook between hide & unhide, I can't seem to get the syntax correct. I have been working on the following but being so new, I am having a hard time referring to the workbook Personal.xls:

    Private Sub HideUnHideWorksheet()
    If Workbooks("Personal.xls").Sheet1.Visable = True Then
    Workbooks("Personal.xls").Sheet1.Visable = False
    Else
    Workbooks("Personal.xls").Sheet1.Visable = True
    End If
    End Sub

    Any ideas would be greatly appreciated. Please help keep it simple. mikeburg

  2. #2
    Norman Jones
    Guest

    Re: Syntax of hide/unhide personal.xls toggle

    Hi Mike,

    Try:

    '==================>>
    Sub Tester()
    With Workbooks("Personal.xls").Sheets(1)
    .Visible = Not (.Visible)
    End With
    End Sub

    '<<==================


    ---
    Regards,
    Norman



    "mikeburg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Help! In trying to come up with a macro to toggle the Personal.xls
    > workbook between hide & unhide, I can't seem to get the syntax correct.
    > I have been working on the following but being so new, I am having a
    > hard time referring to the workbook Personal.xls:
    >
    > Private Sub HideUnHideWorksheet()
    > If Workbooks("Personal.xls").Sheet1.Visable = True Then
    > Workbooks("Personal.xls").Sheet1.Visable = False
    > Else
    > Workbooks("Personal.xls").Sheet1.Visable = True
    > End If
    > End Sub
    >
    > Any ideas would be greatly appreciated. Please help keep it simple.
    > mikeburg
    >
    >
    > --
    > mikeburg
    > ------------------------------------------------------------------------
    > mikeburg's Profile:
    > http://www.excelforum.com/member.php...o&userid=24581
    > View this thread: http://www.excelforum.com/showthread...hreadid=470358
    >




  3. #3
    Dave Peterson
    Guest

    Re: Syntax of hide/unhide personal.xls toggle

    Did you try recording a macro when you unhid personal.xls?

    (It's the simplest I could do.)

    mikeburg wrote:
    >
    > Help! In trying to come up with a macro to toggle the Personal.xls
    > workbook between hide & unhide, I can't seem to get the syntax correct.
    > I have been working on the following but being so new, I am having a
    > hard time referring to the workbook Personal.xls:
    >
    > Private Sub HideUnHideWorksheet()
    > If Workbooks("Personal.xls").Sheet1.Visable = True Then
    > Workbooks("Personal.xls").Sheet1.Visable = False
    > Else
    > Workbooks("Personal.xls").Sheet1.Visable = True
    > End If
    > End Sub
    >
    > Any ideas would be greatly appreciated. Please help keep it simple.
    > mikeburg
    >
    > --
    > mikeburg
    > ------------------------------------------------------------------------
    > mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
    > View this thread: http://www.excelforum.com/showthread...hreadid=470358


    --

    Dave Peterson

+ 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