Syntax of hide/unhide personal.xls toggle

M

mikeburg

Help! In trying to come up with a macro to toggle the Personal.xl
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
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.
mikebur
 
N

Norman Jones

Hi Mike,

Try:

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

'<<==================
 
D

Dave Peterson

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

(It's the simplest I could do.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top