Determine if entire row or column is selected

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.
 
J

JE McGimpsey

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"
 

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

Top