MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Is it possible to identify if column or row has been selected.


Posted by Steve M on July 26, 2001 1:18 AM

I need to identify if users have selected a complete column/s or row/s distinct from only selecting a cell or multiple selection of cells in the worksheet body.

Is there any way using VBA to solve this problem?


Posted by Ivan F Moala on July 26, 2001 1:41 AM

Here's one way assuming excel97/2000

With Selection
If .Rows.Count = 65536 Then
MsgBox "Columns selected"
ElseIf .Columns.Count = 256 Then
MsgBox "Rows selected"
End If
End With