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
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

MickG

MrExcel MVP
Joined
Jan 9, 2008
Messages
14,841
Perhaps:-
Code:
If ActiveCell.Column > 1 Then
MsgBox ActiveCell.Offset(0, -1)
End If
 

xchaser

New Member
Joined
Aug 6, 2011
Messages
18
Hi

try this

On Error Resume Next

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

On Error GoTo 0


regards
 

Callahan

New Member
Joined
Jun 20, 2012
Messages
8
Hello,
Thanks for the reply, unfortunately the above dosent move to next cell normal.
Thanks for the help, any more ideas :)
 

Watch MrExcel Video

Forum statistics

Threads
1,127,606
Messages
5,625,767
Members
416,136
Latest member
senthil_sk

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
Top