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

I've written some code that rebuilds each worksheet in the workbook.
I'm wondering how to ascertain whether a given sheet has any column
groupings and then copy them to the new sheet. Any suggestions are
appreciated.

Thanks in advance

Paul Martin
Melbourne, Australia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default Copy column groupings

Forgive my feeble brain! Im not entirely sure what you mean by Column
Groupings, are you asking for a change to the code your currently using to
rebuild wour worksheets or a fresh piece of code to copy data between sheets
if certain criteria are met?

"Paul Martin" wrote:

I've written some code that rebuilds each worksheet in the workbook.
I'm wondering how to ascertain whether a given sheet has any column
groupings and then copy them to the new sheet. Any suggestions are
appreciated.

Thanks in advance

Paul Martin
Melbourne, Australia

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Copy column groupings

Thanks for the response, Atishoo. I'm referring to (in Excel 2003)
Data, Group and Outline, Group to group columns. Where this has
occurred on a sheet, I want to be able to detect it in code and then
copy it to another sheet.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy column groupings

I think you'll have to look for that outlinelevel:

Option Explicit
Sub testme99()
Dim myRange As Range
Dim myCell As Range
Dim maxLevel As Long

With ActiveSheet
Set myRange = .Rows(1)

maxLevel = 0
For Each myCell In myRange.Cells
If myCell.EntireColumn.OutlineLevel maxLevel Then
maxLevel = myCell.EntireColumn.OutlineLevel
End If
Next myCell

End With
MsgBox "Largest visible level: " & maxLevel

End Sub



Paul Martin wrote:

Thanks for the response, Atishoo. I'm referring to (in Excel 2003)
Data, Group and Outline, Group to group columns. Where this has
occurred on a sheet, I want to be able to detect it in code and then
copy it to another sheet.


--

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
Sorting within Groupings bgc2001 Excel Discussion (Misc queries) 0 November 18th 09 06:06 PM
VBA: Collapse Column Groupings CM4@FL[_2_] Excel Discussion (Misc queries) 1 November 6th 09 09:21 PM
Copy and paste in a sheet with groupings bluebadger Excel Discussion (Misc queries) 0 August 1st 06 02:37 PM
Groupings within PivotTables Fred Excel Worksheet Functions 1 October 18th 05 11:45 PM
Groupings Jason[_28_] Excel Programming 4 January 30th 04 08:08 PM


All times are GMT +1. The time now is 06:21 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"