+ Reply to Thread
Results 1 to 3 of 3

Little problem with the REPLACE method.

  1. #1
    jase
    Guest

    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. #2
    Jim May
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >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. #3
    jase
    Guest

    Re: Little problem with the REPLACE method.

    Thanks
    I'll give that a go

    J


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1