VBA Code to Clear Cell

ERed1

Board Regular
Joined
Jun 26, 2019
Messages
104
Hi all,

I am trying to write a VBA code that will search the column and clear are cell with a specific value. For example, it will search column B for a cell containing the number "1". If it finds a cell contain "1", then that cell gets its contents cleared. I don't want it deleted so other columns and cells don't shift.

Thanks in advance for the help.
 
There is no way that I know of that code could produce that error.
Have you modified it, or added it to some existing code?
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi Fluff. Now I feel like a complete idiot. I closed with out saving & reopened. Apparently something changed. I just love technology. than for responding so quickly.
 
Upvote 0
Not sure I understand what you are on about, this is not your thread. Or are you and ERed1 the same person?
 
Upvote 0
You already have a 0 in those cells.
 
Upvote 0
So, is there a way to get the 0 to be cleared before it gets formatted to "1/0/1900"?
 
Upvote 0
Just replace the 1 in the code from post#4 with a 0
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,048
Members
449,206
Latest member
Healthydogs

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