Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search and Replace...
Patrick, try this
Worksheets("Sheet1").Columns("A").Cells.Replace _ What:="1/1/1900", Replacement:="N/A", _ SearchOrder:=xlByColumns, MatchCase:=True -- Paul B Always backup your data before trying something new Using Excel 97 & 2000 Please post any response to the newsgroups so others can benefit from it ** remove news from my email address to reply by email ** "Patrick Lamb" wrote in message ... 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?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search and Replace | Excel Worksheet Functions | |||
Search and Replace | New Users to Excel | |||
Search and Replace | Excel Discussion (Misc queries) | |||
Search and Replace | Excel Discussion (Misc queries) | |||
Search and Replace... | Excel Programming |