LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Subtotals problem - wierd!

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
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
Very wierd problem. Please help Francis[_5_] Excel Programming 1 May 15th 07 09:35 AM
Wierd Save problem Gareth Saunders Excel Discussion (Misc queries) 2 May 11th 06 04:32 PM
WIERD Excel Problem BK Setting up and Configuration of Excel 8 April 7th 06 12:17 AM
Wierd variable values problem [email protected] Excel Programming 3 December 5th 05 06:13 PM


All times are GMT +1. The time now is 06:56 PM.

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"