Not to run macro if row 1 selected

  • Thread starter Thread starter Joek
  • Start date Start date
J

Joek

I need to run a macro to delete a row if any cell in that row is selected.
However I do not want the macro to run if row 1 is selected.

Seems simple but I can't get my head around it using IF THEN.

I would be grateful for any help
 
How about something like this

If Selection.Row = 1 And _
Selection.Rows.Count = 1 Then Exit Sub
 
with activesheet
If intersect(selection, .rows(1)) is nothing then
'do the work
else
msgbox "don't touch row 1!"
end if
end with
 
Thanks Don - a very simple solution.

I was working at something similar but the macro always hung at this point.

Thank you very much

Joe
 
Back
Top