ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying Outlines (https://www.excelbanter.com/excel-programming/326896-copying-outlines.html)

SIGE

Copying Outlines
 
Hi There,

I have manually set some outlines on my 1st worksheet.

I have like a lot of other sheets with the same "structure"...
Can I copy through VBA the outlines applied on the 1st to all my other sheets?

Sige

Mike Fogleman

Copying Outlines
 
Since you set the outlines manually, Why don't you just select all 13 sheets
and set the outline for all sheets simultaneously?

Mike F
"SIGE" wrote in message
om...
Hi There,

I have manually set some outlines on my 1st worksheet.

I have like a lot of other sheets with the same "structure"...
Can I copy through VBA the outlines applied on the 1st to all my other
sheets?

Sige




Tom Ogilvy

Copying Outlines
 
Can you do it manually?

If not, you probably can't do it with code. If you can, turn on the macro
recorder and do it manually. That is just general advice for a question
like this.

Anyway, I could do it if I copied all the cells or then entire rows for the
outlined area and did a pastespecial formats. However, the outline was
organized exactly like it was on the previous page regardless of the layout
of the data on the new page. (exactly the same rows were grouped - whether
that made sense on the new page or not).

--
Regards.
Tom Ogilvy

"SIGE" wrote in message
om...
Hi There,

I have manually set some outlines on my 1st worksheet.

I have like a lot of other sheets with the same "structure"...
Can I copy through VBA the outlines applied on the 1st to all my other

sheets?

Sige




SIGE

Copying Outlines
 
Hi Mike,

I could have come up with that also ... & "even" tried it!
I vain.

But Tom's solution works fine!
Thx again Sige

"NOSPAM" to be removed for direct mailing...

*** Sent via Developersdex http://www.developersdex.com ***

SIGE

Copying Outlines
 
Hi Tom,

There is no workaround (at all)?
Copy / Paste all formatting is quite drastic...

And the macro-recorder does not show me anything that relates with
Outlines...
Nothing existing like:

Outline.Copy
Selection PasteSpecial Paste:=Outlines

Sige


"NOSPAM" to be removed for direct mailing...

*** Sent via Developersdex http://www.developersdex.com ***

Tom Ogilvy

Copying Outlines
 
I guess the alternative would be to create the outline with code.

Again, the macro recorder would be your friend. <g

--
Regards,
Tom Ogilvy

"SIGE" wrote in message
...
Hi Tom,

There is no workaround (at all)?
Copy / Paste all formatting is quite drastic...

And the macro-recorder does not show me anything that relates with
Outlines...
Nothing existing like:

Outline.Copy
Selection PasteSpecial Paste:=Outlines

Sige


"NOSPAM" to be removed for direct mailing...

*** Sent via Developersdex http://www.developersdex.com ***




SIGE

Copying Outlines
 
I could not record the outline before ...like:
ActiveSheet.Outline.ShowLevels RowLevels:=1
I was just "Grouping" the rows but setting the Outlines.Showlevels was
another matter.

But in the end ... it is ... Tom who is right!
Thx Tom
Sige

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 6/04/2005 by Sige
'
Range("A1:A5").Select
Selection.Rows.Group
Range("A1:E1").Select
Selection.Columns.Group
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=1
ActiveSheet.Outline.ShowLevels RowLevels:=0, ColumnLevels:=2
End Sub

"NOSPAM" to be removed for direct mailing...

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com