View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
bgeier[_11_] bgeier[_11_] is offline
external usenet poster
 
Posts: 1
Default macro for excel, automate task


Option Explicit

Sub xxx()
Dim dblRowCounter As Double
Dim dblSubTOTAL As Double

dblRowCounter = 1
dblSubTOTAL = 0

Do Until Cells(dblRowCounter, 1) = ""
dblSubTOTAL = dblSubTOTAL + Cells(dblRowCounter, 2)
If Cells(dblRowCounter, 1) = "TOTAL" Then
Cells(dblRowCounter, 2) = dblSubTOTAL
dblSubTOTAL = 0
End If
dblRowCounter = dblRowCounter + 1
Loop
End Sub


--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=543082