Suppress Error 1004?

EssKayKay

Board Regular
Joined
Jan 5, 2003
Messages
233
Office Version
  1. 2007
Platform
  1. Windows
First, I must state I am by no means a programmer, so bear with me if you please.

I’m not sure this is possible but is there a way suppress an error message? I know why this is happening but I can’t find where or how to revise my code. Any suggestions would be appreciated.
1705435020154.png

Thanks,
Steve K.
 
I have to believe that this is really quite simple and straight forward.
I know why this is happening but I can’t find where or how to revise my code
I know it is being triggered from protected cells in a specific range but I can’t figure out exactly when it is being triggered
Put a break point at the start of your code to address the first 2 quotes above. The next quote suggests that this is all happening in the sheet SelectionChange event
7. However, this time as a test, do not enter a date in the next available slot but rather click some other cell in column M below the next available payment date.
so I would put the break there. Select a cell in the same column and the code will halt at the breakpoint. F8 one line at a time and watch what is happening. Since you mentioned protection earlier, you must be trying to edit a cell somewhere after the sheet it protected (or when it still is protected if you're not actually cycling protection off/on) and that is what raises the error. Step through the code until you find out which line raises the error.

Only you can really say how to fix this. One way is to leave the protection off until the very last part of the SelectionChange event. Another method might be to test if protection is on for the cell you have a) selected, or b) are trying to change, then if it is, do not allow user to make a change or do not have your code make any change - whichever it is you are doing. Or unprotect and change (or don't protect until the end or exit of this sub as I've already stated.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I have to believe that this is really quite simple and straight forward.


Put a break point at the start of your code to address the first 2 quotes above. The next quote suggests that this is all happening in the sheet SelectionChange event

so I would put the break there. Select a cell in the same column and the code will halt at the breakpoint. F8 one line at a time and watch what is happening. Since you mentioned protection earlier, you must be trying to edit a cell somewhere after the sheet it protected (or when it still is protected if you're not actually cycling protection off/on) and that is what raises the error. Step through the code until you find out which line raises the error.

Only you can really say how to fix this. One way is to leave the protection off until the very last part of the SelectionChange event. Another method might be to test if protection is on for the cell you have a) selected, or b) are trying to change, then if it is, do not allow user to make a change or do not have your code make any change - whichever it is you are doing. Or unprotect and change (or don't protect until the end or exit of this sub as I've already stated.
Thank you very much Micron, I will look at this and see if I can resolve. If not, I'm going to either just leave it as. I'll keep you posted.
 
Upvote 0

Forum statistics

Threads
1,215,310
Messages
6,124,187
Members
449,147
Latest member
sweetkt327

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