View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Display sum of selection with SelectionChange procedure

Hi
before providing a solution: Why don't you use the information in the
taskbar. It does just exactly this?

--
Regards
Frank Kabel
Frankfurt, Germany

"Herman" schrieb im Newsbeitrag
m...
Hello,
I am trying to compose a Worksheet_SelectionChange Sub that will pop
up a display as soon as two or more cells (ALSO NON-CONTIGUOUS ONES
!!!) of a certain column are selected. This display should show the
sum of the selection and update it as more cells are selected.
I have tried this :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count < 2 Then Exit Sub
If Target.Column < 10 Then Exit Sub
MsgBox Application.Sum(Selection)
End Sub

which works fine but the ok button prevents selecting non-adjacent
cells unless you click it.
What I want is a display that continually updates untill I dismiss

it.

Can you help me here?

And another question : how can I EDIT the contents of a message box?
I want the sum shown in 0.000,00 format, font size 12 and bold.

Thank you very much
Herman