Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Little problem with the REPLACE method.

I 'm sure someone has had this problem before.
(It's very similar to a problem I had with the Find method that was
solved in an earlier thread)

Column C is a column of dates, and is formatted as "14-Mar-98".
Some of the cells in column C contain, in integer form, 0 (zero): and
are
therefore returning "0-Jan-00" in the above format. Therefore why
does the below code NOT replace the values in these cells! (the below
doesn 't seem to throw an error either which is sort of strange)
I got the below code from the macro recorder and then just changed
xlPart to xlWhole.

Columns("C:C").Select
Selection.Replace What:="0-Jan-00", Replacement:="n/a", _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
MatchCase:=True

any help greatly appreciated
Jason

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Little problem with the REPLACE method.

Try replacing What:="0-Jan-00" with
What:= 0
Since that is the actual content of the cell.
HTH

"jase" wrote in message
oups.com...
I 'm sure someone has had this problem before.
(It's very similar to a problem I had with the Find method that was
solved in an earlier thread)

Column C is a column of dates, and is formatted as "14-Mar-98".
Some of the cells in column C contain, in integer form, 0 (zero): and
are
therefore returning "0-Jan-00" in the above format. Therefore why
does the below code NOT replace the values in these cells! (the below
doesn 't seem to throw an error either which is sort of strange)
I got the below code from the macro recorder and then just changed
xlPart to xlWhole.

Columns("C:C").Select
Selection.Replace What:="0-Jan-00", Replacement:="n/a", _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
MatchCase:=True

any help greatly appreciated
Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Little problem with the REPLACE method.

Thanks
I'll give that a go

J

Reply
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
Problem using SaveAs method Sujata Excel Discussion (Misc queries) 4 March 30th 10 07:21 AM
VBA in Microsoft Excel: Find & Replace method macro across multiple files Pedro123 Excel Programming 0 September 7th 05 03:48 PM
Problem with find method Ralph Heidecke[_2_] Excel Programming 3 April 18th 05 08:07 PM
InputBox Method Logic Problem ExcelMonkey[_20_] Excel Programming 2 January 24th 04 04:47 AM


All times are GMT +1. The time now is 07:47 AM.

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

About Us

"It's about Microsoft Excel"