Toggle Marco . . .

  • Thread starter Thread starter Fable
  • Start date Start date
F

Fable

Greetings,

Im trying to get a macro button to "toggle" to cycle through th
different grouped views I created but I keep getting a compiling error
VBA is not my forte as maybe you can see and thoughts what Im doin
wrong?


Sub Toggle_View()
'
Sheets("Sheet1").Select
With ActiveSheet
If ActiveSheet.Outline.ShowLevels RowLevels:=1 = True then
ActiveSheet.Outline.ShowLevels RowLevels:=2 False
ActiveSheet.Outline.ShowLevels RowLevels:=3 False
Else
ActiveSheet.Outline.ShowLevels RowLevels:=2 True
ActiveSheet.Outline.ShowLevels RowLevels:=1 False
ActiveSheet.Outline.ShowLevels RowLevels:=3 False
Else
ActiveSheet.Outline.ShowLevels RowLevels:=3 True
ActiveSheet.Outline.ShowLevels RowLevels:=1 False
ActiveSheet.Outline.ShowLevels RowLevels:=2 False
End If
End With
End Sub

Thanking you in advance
 
You have one response at your other post.
Greetings,

Im trying to get a macro button to "toggle" to cycle through the
different grouped views I created but I keep getting a compiling error,
VBA is not my forte as maybe you can see and thoughts what Im doing
wrong?

Sub Toggle_View()
'
Sheets("Sheet1").Select
With ActiveSheet
If ActiveSheet.Outline.ShowLevels RowLevels:=1 = True then
ActiveSheet.Outline.ShowLevels RowLevels:=2 False
ActiveSheet.Outline.ShowLevels RowLevels:=3 False
Else
ActiveSheet.Outline.ShowLevels RowLevels:=2 True
ActiveSheet.Outline.ShowLevels RowLevels:=1 False
ActiveSheet.Outline.ShowLevels RowLevels:=3 False
Else
ActiveSheet.Outline.ShowLevels RowLevels:=3 True
ActiveSheet.Outline.ShowLevels RowLevels:=1 False
ActiveSheet.Outline.ShowLevels RowLevels:=2 False
End If
End With
End Sub

Thanking you in advance!
 
Dave,
If you know where the other post is, why not add that bit of information in
case someone wants to see your solution. (like worksheet.functions or misc
is enough).

Just a thought.

--
Regards,
Tom Ogilvy

Dave Peterson said:
You have one response at your other post.
 
In this case, it was:

Newsgroups: microsoft.public.excel.misc
Subject: Re: Toggle Marco . . .



Tom said:
Dave,
If you know where the other post is, why not add that bit of information in
case someone wants to see your solution. (like worksheet.functions or misc
is enough).

Just a thought.

--
Regards,
Tom Ogilvy

Dave Peterson said:
You have one response at your other post.
 

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

Back
Top