T
tango
dear all/bob,
got alot of error in the syntax. can help.
thanks
From: Bob Phillips
Date Posted: 10/27/2004 3:55:00 AM
Here is some code
Dim i As Long
Dim sHead As String
Dim nTotal
sHead = Left(Range("A1").Value, 1)
nTotal = 0
For i = 1 To Cells(rows.Count, "A").End(xlUp).Row
If Cells(i, "A").Value = "" Then
Cells(i, "A").Value = "Total for " & sHead
Cells(i, "B").Value = nTotal
sHead = Left(Cells(i + 1, "A").Value, 1)
nTotal = 0
Else
nTotal = nTotal + Cells(i, "B").Value
End If
Next i
Cells(i, "A").Value = "Total for " & sHead
Cells(i, "B").Value = nTotal
got alot of error in the syntax. can help.
thanks
From: Bob Phillips
Date Posted: 10/27/2004 3:55:00 AM
Here is some code
Dim i As Long
Dim sHead As String
Dim nTotal
sHead = Left(Range("A1").Value, 1)
nTotal = 0
For i = 1 To Cells(rows.Count, "A").End(xlUp).Row
If Cells(i, "A").Value = "" Then
Cells(i, "A").Value = "Total for " & sHead
Cells(i, "B").Value = nTotal
sHead = Left(Cells(i + 1, "A").Value, 1)
nTotal = 0
Else
nTotal = nTotal + Cells(i, "B").Value
End If
Next i
Cells(i, "A").Value = "Total for " & sHead
Cells(i, "B").Value = nTotal