VBA issue with Replace

cstimart

Well-known Member
Joined
Feb 25, 2010
Messages
1,180
I am using the following line
Code:
Range("O2:U" & LR).Replace What:="", Replacement:=#12/31/3099#, LookAt:=xlWhole

It's filling EVERY empty cell in the "used range" (which is A1:Z19257) with the 12/31/3099 date. :confused:

What am I missing?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
it will
you are searching for cell having "" that means blank cells.

which cell do you want to replace. specify.
 
Upvote 0
Try:
Code:
With Range("O2:U" & LR)
   .Find what:="*"
   .Replace What:="", Replacement:=#12/31/3099#, LookAt:=xlWhole
end with
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,267
Members
452,902
Latest member
Knuddeluff

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