ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search and Replace... (https://www.excelbanter.com/excel-programming/278762-search-replace.html)

Patrick Lamb

Search and Replace...
 
I am trying to write a search and replace macro to
replace 01/01/1900 with N/A. It refuses to work. I am
using Excel 2000.

Here is the following to reproduce the problem.

Start a new excel spreadsheet. Key Test into A1 and
01/01/1900 into cell A2. Create the following macro and
run it.

Sub Search_And_Replace()

Worksheets("Sheet1").Columns("A").Replace _
What:="Test", Replacement:="N/A", _
SearchOrder:=xlByColumns, MatchCase:=True

Worksheets("Sheet1").Columns("A").Replace _
What:="01/01/1900", Replacement:="N/A", _
SearchOrder:=xlByColumns, MatchCase:=True

End Sub

It happily replaces Test with N/A but not 01/01/1900.
What am I doing wrong??


All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com