1

This is odd. In the code below the replace() does not replace the : character. Why? How do I fix this? Even if I switch ":" with chr(58) it doesn't work.

Dim dispName as String
dispName = "     110531 Re:Our file 027-10.doc"
dispName = Replace(dispName, ":", " ")
msgbox dispName
4
  • 2
    Codes workes for me fine with Excel 2007 Commented Feb 24, 2015 at 15:03
  • 4
    look at your :, it looks like that is not the same as the other one Commented Feb 24, 2015 at 15:05
  • 1
    @Katz You are right :) Commented Feb 24, 2015 at 15:08
  • 1
    So weird - VBA identifies both with chr() as 58. Thanks for the help. Commented Feb 25, 2015 at 7:16

1 Answer 1

2

I copied your code as it is to notepad++ and found that used both ':' characters are different.

Change both to the same and run the code

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.