![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Plano, Texas
Posts: 29
|
I am attempting to subtotal using a For Each Next Construct; however, I do not know which "element" to use to identify a change in my range.
The syntax is as follows: For Each element In group [Instructions] [Exit For] [Instructions] Next [element] I am wanting a subtotal row for each change in range A8:A65536, but the VBA does not recognize "Change" as a valid element. Any help will be greatly appreciated. |
|
|
|
|
|
#2 |
|
New Member
Join Date: Apr 2002
Location: Plano, Texas
Posts: 29
|
I aplogize if this is poor board etiquette, but I really need some help with this. So, TTT...
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi Larry.
I am fairly new with Excel and will try to help you out, but I do not understand exactly what you are trying to do??? Tom |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Boston, MA
Posts: 105
|
Please post some sample (condensed) data, so we can give you a hand.
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Apr 2002
Location: Plano, Texas
Posts: 29
|
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Apr 2002
Location: Plano, Texas
Posts: 29
|
I am attempting to insert custom subtotals after each change in part number that is located in column A. For example:
Part# Qty 55012 15 55012 12 55012 1 55013 5 55013 8 55014 0 I am trying to use the For Each-Next Construct to say for each change in part number, insert a subtotal row. I have written the code for the subtotals, but they are acting as a grand total since they are going directly to the bottom of my data set. I am using this For/With statement to insert the subtotals for each column I want totaled but I dont know what to use to get this at each change in part number. With Sheets("Report").Cells(rowcount + 7, 5) .Formula = "=Sum(E7:E" & rowcount + 6 & ")" .Font.Bold = True End With Hopefully, this will help make my request a little clearer. I am very new to Excel Developing and I'm still unsure of the terminology. _________________ Thanks, Larry [ This Message was edited by: Larry on 2002-04-16 07:09 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|