View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tim Zych Tim Zych is offline
external usenet poster
 
Posts: 389
Default Detect if current select is a row

Other options, customize depending on how much control you want to have, or
to what degree you want to flex based on the user selection.

' To accept the top left cell as the starting point, but expand to the
entire row. One row max.
Selection.Cells(1,1).EntireRow.Delete

' To allow multiple rows to be deleted at one time
Selection.EntireRow.Delete

' To force the user to re-select
With Selection
If .Rows.Count 1 Or .Columns.Count < Columns.Count Then
MsgBox "Select one row to delete from."
Else
.EntireRow.Delete
End If
End With

--
Regards,
Tim Zych
http://www.higherdata.com
Workbook Compare - Excel data comparison utility

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