ClearContents bug help

ddub25

Well-known Member
Joined
Jan 11, 2007
Messages
617
Office Version
  1. 2019
Platform
  1. Windows
I created a Command Button with the following code.

Private Sub CommandButton1_Click()
Sheets("IB_FB_H_3_Working").Range("$D$7:$D$8,$G$9:$L$34,$M$9,$M$18,$M$27,$N$9,$N$18,$N$27,$O$9:$O$34,$T$9:$T$34,$V$9:$V$34").ClearContents
End Sub

Whenever I use it, it returns the error message, "Code execution has been interrupted". Even so, it does manage to clear the cells that I want cleared. When I click 'Debug',
it brings up the code with the 'End Sub'part highlighted in yellow. Is this the problem part? It hasn't been a problem in the past. Can anyone help?

Dan
 
OK -- but next time you're working on something pretty big, try it. It happens to me all the time.
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

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