View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Detect if current select is a row

Why test if the entire row is selected when you can force the selection of
the entire row; something like this...

' Ask user to select the row as you do now, then run this code
If Selection.Columns = 1 Then
Selection.EntireRow.Select
'
' the rest of your code goes here
'
Else
MsgBox "You selected more than one row!"
End If

Although I'm willing to bet that you don't really need to perform the
selection operation as opposed to simply working with the range itself in
code.

--
Rick (MVP - Excel)


"Billy B" wrote in message
...
Is it possible to test to see if the current selection is a row? I have a
command button that is designed to delete the selected row but but I need
to
test to see if it is selected before running the rest of the macro.

Thank you.