Sum Visible

  • Thread starter Thread starter MattShoreson
  • Start date Start date
M

MattShoreson

I have an addin which has a menu item calling a procedure summing al
visible cells in a selection.

I am having problems setting the range/selection to be active withi
the proc.

Dim sum_range As Object
Set sum_range = Selection
MsgBox sum_range.Column.Count

Does anyone have any ideas
 
Hi Matt

Sub test()
Dim sum_range As Range
Set sum_range = Selection.SpecialCells(xlCellTypeVisible)
MsgBox Application.Sum(sum_range)
End Sub

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top