Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
Below is the code l am using to apply subtotals & then subtotals to the subtotals. It works fine on the machine l have developed it on but when l use the workbook on another machine it gives different results! Both work without any errors but as l say different result. Both machines are using Windows XP SP2 and Excel 2003 SP2. I have noticed that on the development machine l only have 4 outline levels whereas on the 'new' machine l have 5. Anybody got any ideas? Note: LC is a function used to determine the Last Column Sub SKILLS_SubTotals() Dim myCols As Variant 'Location of array Dim SC As Integer '1st column to apply subtotals Application.ScreenUpdating = False Sheets("Staff Planner").Activate '--------------- 'Build the array '--------------- '....determine start column SC = 8 '....build ReDim myCols(SC To LC) For i = LBound(myCols) To LC myCols(i) = i Next i '-------------------------------------------------- 'Select range & apply subtotals to the myCols array '-------------------------------------------------- If IsArray(myCols) Then Range(Cells(3, 1), Cells(LR, LC)).Select Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(myCols), _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True Range(Cells(3, 1), Cells(LR, LC)).Select Selection.Subtotal GroupBy:=4, Function:=xlSum, TotalList:=Array(myCols), _ Replace:=False, PageBreaks:=False, SummaryBelowData:=True End If End Sub Regards Michael B |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtotals problem: Excel 2003 (not, AFAIK, the nested subtotals bug) | Excel Discussion (Misc queries) | |||
Very wierd problem. Please help | Excel Programming | |||
Wierd Save problem | Excel Discussion (Misc queries) | |||
WIERD Excel Problem | Setting up and Configuration of Excel | |||
Wierd variable values problem | Excel Programming |