View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Sum of Highlighted values

Sub sumselection()'non-contiguous assign to button or shape
MsgBox Application.Sum(Selection)
End Sub

'below ONLY if a contiguous selection.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox Application.Sum(Selection)
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Khusro" wrote in message
...
Is there any way I can perform calculation on the basis of cell formatting
such as get the sum of highlighted cells