Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default group method - is there a collection

Through a VB program, I'd like to modify some data for all rows that have
been grouped together using the .group method.

Is there a collection, object, or some other method that I can use to find
the group and traverse through it?

For example, I have the below code to group some rows:

Dim xlWB As Excel.Application
Dim rng As Range
Set xlWB = AppInstance

Set rng = xlWB.Rows("3:5")
rng.Group


At a later point in time, I want to go back through the group and modify
some of the information programmatically. What options are available?

thanks - jimm


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default group method - is there a collection

jimm,

The built-in options look limited. The Range.OutlineLevel doesn't appear
to be of any benefit. See if the following can get you started...

'----------------------------
Sub GroupAndGrab()
Dim rng As Range
Dim lngN As Long
Dim strArray() As String
ReDim strArray(1 To 1000)

Set rng = Range("B7:B9").EntireRow
rng.Group
strArray(rng.Row) = rng.Address

Set rng = Rows("29:39")
rng.Group
strArray(rng.Row) = rng.Address

'do something else

For lngN = 1 To 1000
If Len(strArray(lngN)) Then
Set rng = Range(strArray(lngN))
rng.Font.Bold = True
End If
Next
End Sub
'----------------------------

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"jimm" wrote in message

Through a VB program, I'd like to modify some data for all rows that have
been grouped together using the .group method.
Is there a collection, object, or some other method that I can use to find
the group and traverse through it?

For example, I have the below code to group some rows:

Dim xlWB As Excel.Application
Dim rng As Range
Set xlWB = AppInstance

Set rng = xlWB.Rows("3:5")
rng.Group


At a later point in time, I want to go back through the group and modify
some of the information programmatically. What options are available?

thanks - jimm


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
Please post this thread a correct full method, method about Nast Runsome New Users to Excel 8 February 25th 08 03:29 PM
Please post this thread a complete correct method, method about te Nast Runsome New Users to Excel 0 February 23rd 08 09:42 PM
GetObject method not work after Call Shell Method ben Excel Programming 8 February 21st 06 03:45 PM
Why QUIT method doesn't work after COPY method? surotkin Excel Programming 3 October 26th 05 04:32 PM
Group Method failed in macro Ivan Excel Programming 0 September 3rd 05 06:07 AM


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

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

About Us

"It's about Microsoft Excel"