View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
mrice mrice is offline
external usenet poster
 
Posts: 1
Default totaling indented subsections


Try this user defined function

Function Check(Cell As Range)
If Left(Cell, 7) = " " Then
Check = ""
Else
Counter = 1
Do While Left(Cell.Offset(Counter, 0).Value, 7) = " "
Total = Total + Cell.Offset(Counter, 1)
Counter = Counter + 1
Loop
If Total = Cell.Offset(0, 1) Then
Check = True
Else
Check = False
End If
End If
End Function

Paste this into a VBA module and type =CHECK(A1) into cell C1 and copy
down.


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=564712