Thread: Stop
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Stop

You have 2 options:
- Check where the active cell is first.
If ActiveCell.Column 1 Then ActiveCell.Offset(0, -1).Select

- Do it anyway and ignore the error, as (in this case) no damage is done or
propagated by the error.
On Error Resume Next
ActiveCell.Offset(0, -1).Select
On Error GoTo 0

NickHK

"StargateFan" wrote in message
...
I always seem to come across interesting things as I make up new
workbooks. I'm using the following code to allow user to step to the
left:

ActiveCell.Offset(0, -1).Select

Butt when user gets to A1, if the button is pushed again by accident,
an error box comes up because the first cell is reached:

Run-time error '1004': Application-defined or object-defined error

Is there any way to stop this error popping up? Any advice re this?
Even a message saying "you can't go any further to the left", heck,
whatever works <g.

Thanks. :oD