Thread: Error Handle
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PR[_3_] PR[_3_] is offline
external usenet poster
 
Posts: 7
Default Error Handle

I have a marco that helps sort a range of cells, but if a user, choices some
other cells I get an error 'runtime error 1004'

I would like to put some error handling around this, just to say cannot use
this with the cell that they have been selected.

Can anyone help?

Here is the code;

Range("A7:BP150").Select
Selection.Sort Key1:=Range("B7"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A7").Select

Thanks Paul