Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable Subtotal range
If I have Subtotal Categories in Col A (EG: Total Plant Costs, Total Hire
Costs etc-up to 20 over several hundred rows of data and 12 months in columns). Each project subtotal will have a different range. How do I subtotal a column based on a change in subtotal category? I use the following code to find the current month column based on the data date and will need to subtotal adjustments one column to the right for each category change: Sub FindCurMonthM324() Dim CurLocation As Range Dim addr As String Dim curDate As String Dim rng As Range Application.ScreenUpdating = False curDate = Sheets("Control").Range("B1").Value Sheets("CheopsM324").Rows(10).NumberFormat = "general" On Error Resume Next Set CurLocation = Rows(10).Find(What:=curDate, LookIn:=xlValues) Set rng = Range(CurLocation.Address) Debug.Print (rng.Address) Application.ScreenUpdating = True If Not CurLocation Is Nothing Then addr = CurLocation.Address CurLocation.Offset(3, 0).Select Else MsgBox "Period Date Not Found" End If Sheets("CheopsM324").Rows(10).NumberFormat = "mmm-yy" End Sub -- Jim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Please help - subtotal using vlookup depending on variable month | Excel Discussion (Misc queries) | |||
Subtotal variable range | Excel Worksheet Functions | |||
Subtotal of Abs of a range? | Excel Worksheet Functions | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Problem trying to us a range variable as an array variable | Excel Programming |