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

Look for a cell in that row that has a formula that starts with "=subtotal("?

Darren Ludlam wrote:

How can I dynamically identify if a row is a subtotal


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default identifying subtotals

Providing that you have a continuous stream of data in row "A" (No empty
cells!) then the following will work. If you do have gaps then you may need
to use the following as the selection method
Range(Range("A1"), Range("A50000").end(xlup).Select

May be someone else can help out here, in the following sub what should i be
declaring "rng" as ?

Sub totalRows()
Dim rng As Variant

Range(Range("A1"), Range("A1").End(xlDown)).Select
For Each rng In Selection
If Right(rng.Value, 5) = "Total" Then
MsgBox rng.Row & " is a subTotal row"
End If
Next rng
End Sub




"Darren Ludlam" wrote in message
...
How can I dynamically identify if a row is a subtotal




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default identifying subtotals

dim rng as range

seems to make a lot of sense here.

Stuart wrote:

Providing that you have a continuous stream of data in row "A" (No empty
cells!) then the following will work. If you do have gaps then you may need
to use the following as the selection method
Range(Range("A1"), Range("A50000").end(xlup).Select

May be someone else can help out here, in the following sub what should i be
declaring "rng" as ?

Sub totalRows()
Dim rng As Variant

Range(Range("A1"), Range("A1").End(xlDown)).Select
For Each rng In Selection
If Right(rng.Value, 5) = "Total" Then
MsgBox rng.Row & " is a subTotal row"
End If
Next rng
End Sub

"Darren Ludlam" wrote in message
...
How can I dynamically identify if a row is a subtotal



--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default identifying subtotals

How can I dynamically identify if a row is a subtotal


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
Subtotals problem: Excel 2003 (not, AFAIK, the nested subtotals bug) AndyCotgreave Excel Discussion (Misc queries) 3 October 24th 07 11:32 AM
Original subtotals should not be within nested subtotals in excel Mirage Excel Worksheet Functions 1 June 6th 07 01:37 AM
How do I copy an outline w/ subtotals & paste just the subtotals av Excel Discussion (Misc queries) 1 June 20th 05 11:35 PM
Problem with nested subtotals, placing secondary subtotals BELOW . Dawn Cameron Excel Discussion (Misc queries) 1 June 3rd 05 10:13 PM
why are nested subtotals coming out below outer subtotals? Hendy Excel Worksheet Functions 2 January 18th 05 08:09 PM


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