Avoid run-time error 1004

Callahan

New Member
Joined
Jun 20, 2012
Messages
8
Hello is there anyway of avoiding this error crashing my Marco when you try and go to a cell which isn't there when using
activecell.offset(0,-1)
I've tried adding error handling but I'm doing it wrong

Thanks
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Perhaps:-
Code:
If ActiveCell.Column > 1 Then
MsgBox ActiveCell.Offset(0, -1)
End If
 
Upvote 0
Hi

try this

On Error Resume Next

---put the line of code that creates 1004 error here---

On Error GoTo 0


regards
 
Upvote 0
Hello,
Thanks for the reply, unfortunately the above dosent move to next cell normal.
Thanks for the help, any more ideas :)
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,923
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top