Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Toggle Marco . . .


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

--
Fabl

-----------------------------------------------------------------------
Fable's Profile: http://www.excelforum.com/member.php...nfo&userid=218
View this thread: http://www.excelforum.com/showthread.php?threadid=27192

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Toggle Marco . . .

You have one response at your other post.

Fable wrote:

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!

--
Fable

------------------------------------------------------------------------
Fable's Profile: http://www.excelforum.com/member.php...fo&userid=2185
View this thread: http://www.excelforum.com/showthread...hreadid=271920


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Toggle Marco . . .

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" wrote in message
...
You have one response at your other post.

Fable wrote:

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!

--
Fable

------------------------------------------------------------------------
Fable's Profile:

http://www.excelforum.com/member.php...fo&userid=2185
View this thread:

http://www.excelforum.com/showthread...hreadid=271920

--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Toggle Marco . . .

In this case, it was:

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



Tom Ogilvy wrote:

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" wrote in message
...
You have one response at your other post.

Fable wrote:

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!

--
Fable

------------------------------------------------------------------------
Fable's Profile:

http://www.excelforum.com/member.php...fo&userid=2185
View this thread:

http://www.excelforum.com/showthread...hreadid=271920

--

Dave Peterson


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marco Puzzled Excel Discussion (Misc queries) 3 July 30th 07 05:09 PM
Marco Help looper Excel Discussion (Misc queries) 2 May 12th 07 06:55 PM
I need some help with a Marco xgunda420x Excel Discussion (Misc queries) 2 August 2nd 05 01:43 PM
Marco Loi New Users to Excel 4 December 7th 04 08:52 PM
Can it be done by marco? kaon[_5_] Excel Programming 1 June 28th 04 10:56 AM


All times are GMT +1. The time now is 01:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"