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

Hi,

I'm using excel 2000 and I'm trying to memorize the current outline to
be able to restore it later.

I tried this on the following sheet, the 3 "a"s are grouped and the 3
"b"s to.

a 1
a 2
a 3
b 1
b 2
b 3


Sub TEST()
Dim PLAN As Outline

Set PLAN = ActiveSheet.Outline ' memorize the outline
ActiveSheet.Outline.ShowLevels 2 ' modify it
MsgBox "hello"
Set ActiveSheet.Outline = PLAN ' want to restore it
' but get an error
here
End Sub


I am able to memorize the current outline but I am not able to restore
it ...

Anyone has an idea of how to proceed ?

Thanks for any hints.

René.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Memorizing current outline

You have not memorised the outline, but merely set a variable name to
the object so you can use :-
'-----------------------------
Dim PLAN As Outline
Set PLAN = ActiveSheet.Outline
PLAN.ShowLevels rowLevels:=3, columnLevels:=1
'------------------------------

I think you will need something like this :-
'-----------------------------------------
Dim RowLevels(100)
Dim ColLevels(256)
'-----------------------------------------
Sub RecordOutline()
For rw = 1 To 100
RowLevels(rw) = ActiveSheet.Rows(rw).OutlineLevel
Next
For col = 1 To 256
ColLevels(col) = ActiveSheet.Rows(col).OutlineLevel
Next
End Sub
'-----------------------------------------
Sub ResetOutline()
For rw = 1 To 100
ActiveSheet.Rows(rw).OutlineLevel = RowLevels(rw)
Next
For col = 1 To 256
ActiveSheet.Columns(col).OutlineLevel = ColLevels(col)
Next
End Sub
'-----------------------------------------------
The arrays are not permanent. If these routines are not called from
the same macro you will need to hold the values in a worksheet instead
(perhaps in hidden rows/columns of the Activesheet). eg. ........

ActiveSheet.Rows(rw).OutlineLevel = ActiveSheet.Cells(rw,1).Value

Regards
BrianB
==================================


rlenaers wrote in message ...
Hi,

I'm using excel 2000 and I'm trying to memorize the current outline to
be able to restore it later.

I tried this on the following sheet, the 3 "a"s are grouped and the 3
"b"s to.

a 1
a 2
a 3
b 1
b 2
b 3


Sub TEST()
Dim PLAN As Outline

Set PLAN = ActiveSheet.Outline ' memorize the outline
ActiveSheet.Outline.ShowLevels 2 ' modify it
MsgBox "hello"
Set ActiveSheet.Outline = PLAN ' want to restore it
' but get an error
here
End Sub


I am able to memorize the current outline but I am not able to restore
it ...

Anyone has an idea of how to proceed ?

Thanks for any hints.

René.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
Current year and current week number Grey Old Man[_2_] Excel Discussion (Misc queries) 11 December 8th 09 06:30 PM
Outline of current cell in Excel (for) Mac darker suzie Excel Discussion (Misc queries) 1 September 14th 07 06:56 AM
Having the current time inserted w/o updating the current time sherobot Excel Worksheet Functions 2 October 2nd 06 05:05 PM
outline Vinaya Excel Worksheet Functions 2 June 22nd 06 08:01 PM
Can I automatically enter the current date or current time into a Ben New Users to Excel 7 October 19th 05 03:38 PM


All times are GMT +1. The time now is 10:18 AM.

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"