LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default VBA Replace Dates

Hi Matt,

I have an Excel worksheet which pulls data from SQL Server which treat

null
dates as 01/01/1900

I'm trying to replace all such dates with blanks on the worksheet



if you have the chance try to solve the problem where the data is coming
from, eg. change the sql-statement to
IIF(mydate = 1/1/1900, NULL, mydate).

For me, changing the numberformat to standard and then replacing the value 1
with nothing worked, eg:
Range("B2:B9").Select
Selection.NumberFormat = "General"
Range("B7:B8").Select
Selection.Replace What:="1", Replacement:="test", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

arno


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Can I replace a ' at the beginning of a text cell using Replace Hilde Excel Discussion (Misc queries) 4 September 10th 07 06:22 PM
How to replace a date, change May to June keeping numerical dates dolphinks72002 Excel Discussion (Misc queries) 2 April 27th 06 01:10 AM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
How do I replace dates earlier than certain date? Jose Martinez Excel Discussion (Misc queries) 4 April 29th 05 09:50 PM


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"