P
Pete
I execute this piece of code 5 times during a Sub, can
anyone tell me how to write a procedure that can be
generic e.g
Sub MyProcedure(DailyDischargeBelt(),TotalDischargBelt
(),Col,Col1)
Then ratehr that typing all of the below in 5 times
changing the variables, the procedure would handle that
for me
Ctr = 0
For Ctr = 1 To 16
DailyDischargeBelt(Ctr) = Sheets("MinorStops").Cells
(1 + Ctr, 4).Value
TotalDischargeBelt(Ctr) = Sheets("MinorStops").Cells
(1 + Ctr, 5).Value
TotalDischargeBelt(Ctr) = TotalDischargeBelt(Ctr) +
DailyDischargeBelt(Ctr)
Sheets("MinorStops").Cells(1 + Ctr, 5).Value =
TotalDischargeBelt(Ctr)
Next Ctr
Hope that makes sense
Pete
anyone tell me how to write a procedure that can be
generic e.g
Sub MyProcedure(DailyDischargeBelt(),TotalDischargBelt
(),Col,Col1)
Then ratehr that typing all of the below in 5 times
changing the variables, the procedure would handle that
for me
Ctr = 0
For Ctr = 1 To 16
DailyDischargeBelt(Ctr) = Sheets("MinorStops").Cells
(1 + Ctr, 4).Value
TotalDischargeBelt(Ctr) = Sheets("MinorStops").Cells
(1 + Ctr, 5).Value
TotalDischargeBelt(Ctr) = TotalDischargeBelt(Ctr) +
DailyDischargeBelt(Ctr)
Sheets("MinorStops").Cells(1 + Ctr, 5).Value =
TotalDischargeBelt(Ctr)
Next Ctr
Hope that makes sense
Pete