Activecell Count

C

Corey

Is there a way to have a cell(Say L59) display how many cells are selected.
I am using the Ctrl + Mouse to select multiply cells, but want to know how many cells are in total slected.

I tried:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("L59").Value = ActiveCell.Count
End Sub

But it only seem to show - 1 and nevr changes when more than 1 cell is selected.
 
D

Don Guillett

Pls post in plain text and top post

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox Target.Cells.Count
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
[email protected]

Is there a way to have a cell(Say L59) display how many cells are selected.
I am using the Ctrl + Mouse to select multiply cells, but want to know how
many cells are in total slected.

I tried:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("L59").Value = ActiveCell.Count
End Sub

But it only seem to show - 1 and nevr changes when more than 1 cell is
selected.
 
J

John_John

You can also use the "Selection" object as above:

Range("L59").Value = Selection.Cells.Count

John

Ο χÏήστης "Corey" έγγÏαψε:
 
Top