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: 112
Default Help with Grand Total and Positioning Please

Hi Everyone,

I have a Macro that Calculates the Total Results for a Width of a Line
and Writes them to a Spreadsheet, this Works Perfectly.
I Need Two More things though Please.
The First Being the Grand Total of the Results Directly Underneath the
Last Results Value.
The Second is for it to Actually Output the Results Starting in Cell
"A1", I have the Range Set to "A1" in the Macro, But for Some Reason it
Starts the Results Output in Cell "A2".
Any Help will be Greatly Appreciated.
This is the Macro I am Using :-

Option Explicit
Option Base 1
Sub Spread()
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Dim E As Integer
Dim F As Integer
Dim nType(7) As Double
Dim I As Integer
Application.ScreenUpdating = False
Sheets("Output").Select
Range("A1").Select
For I = 1 To 7
nType(I) = 0
Next I
For A = 1 To 24
For B = A + 1 To 25
For C = B + 1 To 26
For D = C + 1 To 27
For E = D + 1 To 28
For F = E + 1 To 29
If F - A = 5 And F - A <= 7 Then nType(1) = nType(1) + 1
If F - A = 8 And F - A <= 10 Then nType(2) = nType(2) + 1
If F - A = 11 And F - A <= 13 Then nType(3) = nType(3) + 1
If F - A = 14 And F - A <= 16 Then nType(4) = nType(4) + 1
If F - A = 17 And F - A <= 19 Then nType(5) = nType(5) + 1
If F - A = 20 And F - A <= 24 Then nType(6) = nType(6) + 1
If F - A = 25 And F - A <= 29 Then nType(7) = nType(7) + 1
Next F
Next E
Next D
Next C
Next B
Next A
For I = 1 To 7
ActiveCell.Offset(I, 0).Value = nType(I)
Next I
End Sub

Thanks in Advance.
All the Best
Paul




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
Duplicate Running Total Grand Total In Pivot Table Mathew P Bennett[_2_] Excel Discussion (Misc queries) 1 August 17th 08 03:13 AM
Excel 2002 : Any single button to get sub total and grand total ? Mr. Low Excel Discussion (Misc queries) 2 May 22nd 07 08:46 AM
Pivots - Auto calc % Sub total is of grand total VBA Noob Excel Discussion (Misc queries) 3 August 8th 06 08:46 PM
Old Lotus Sub Total & Grand Total formula Kylie Excel Discussion (Misc queries) 2 April 9th 06 12:24 PM
Adding Data Using Multiple Worksheets to Total into a Grand Total Lillie Excel Worksheet Functions 1 April 19th 05 08:34 PM


All times are GMT +1. The time now is 09:36 AM.

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"