View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Matt J[_2_] Matt J[_2_] is offline
external usenet poster
 
Posts: 1
Default 1004 error when selecting a range

I have the follwoing code in a macro and it works fine

Sheets("SOAUDITSO").Select
Rows("2:2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp

When I copy it to a ClickEvent for a command button it returns a Run-time 1004 error "Select method of Range class failed"

I'M new to VBA and please excuse me for being so naive