K, what parts, i've made a few functions and stuff....heres one of the main functions....
VB Code:
Function totalPGEPump()
Dim colName As String
Dim pltName(1 To 17) As String
Dim pltType As String
Dim nDay As Long
Dim day As Long
Dim nHour As Long
Dim hour As Long
Dim i As Long
Dim pltRow As Long
Dim subRow As Long
Dim totalNameCell As String
Dim functionName As String
Dim colNameNum As Long
Dim hourlyTotalArray(30, 24) As Double
Dim totalPlants As Long
'pltType is the type of the plants that are being totaled
pltType = "Pump"
'functionName is the name that will appear as the blocks title in the worksheet
functionName = "PG&E Area " & pltType
'totalNameCell is the cell in which the name will appear
totalNameCell = "AP1893"
Cells((detExlRow(totalNameCell)), detExlCol(totalNameCell)) = functionName
'the column in which the names of the plants are listed.
'use the first cell in that column.
colName = "AQ1"
colNameNum = detExlCol(colName)
'Names of the plants in no order. Add more by increasing the 'dim' above _
'and also by increasing the while loop below.
pltName(1) = "Badger Hill"
pltName(2) = "Banks"
pltName(3) = "Barker Slough"
pltName(4) = "Bluestone"
pltName(5) = "Buena Vista"
pltName(6) = "Chrisman"
pltName(7) = "Cordelia (new)"
pltName(8) = "Del Valle"
pltName(9) = "Devils Den"
pltName(10) = "Dos Amigos"
pltName(11) = "Gianelli"
pltName(12) = "Hyatt"
pltName(13) = "Las Perillas"
pltName(14) = "Polonio"
pltName(15) = "South Bay"
pltName(16) = "Teerink"
pltName(17) = "Therm"
i = 1
subRow = detExlRow(totalNameCell)
totalPlants = 17
nDay = 30 - 1
day = 0
nHour = 23
hour = 0
While i <= totalPlants
pltRow = searchForPlantName(colName, pltName(i), pltType)
While day <= nDay
While hour <= nHour
hourlyTotalArray(day, hour) = hourlyTotalArray(day, hour) + Cells(pltRow + day, colNameNum + 1 + hour)
hour = hour + 1
Wend
day = day + 1
hour = 0
Wend
day = 0
i = i + 1
Wend
While day <= nDay
While hour <= nHour
Cells(subRow + day, colNameNum + 1 + hour) = hourlyTotalArray(day, hour)
hour = hour + 1
Wend
day = day + 1
hour = 0
Wend
End Function
Lemme know if you want some more, or certian functions from this peice.
Sorry bout the wrong forum thing...
EDIT: Lost all my formating, sorry.