Determine if entire row or column is selected

  • Thread starter Thread starter MC82
  • Start date Start date
M

MC82

Is there a way I can determine if an entire row or column is selected?

So if I select Column A, I can get my macro to recognize that I have
done so and do a certain function.
 
One way:

Dim bEntireColumn As Boolean
Dim bEntireRow As Boolean
With Selection
bEntireColumn = .Address = .EntireColumn.Address
bEntireRow = .Address = .EntireRow.Address
End With
If bEntireColumn Then MsgBox "Entire column(s) selected"
If bEntireRow Then MsgBox "Entire row(s) selected"
 
Back
Top