+ Reply to Thread
Results 1 to 8 of 8

Need help with REPLACE function to replace HEX A0 with HEX 20 in string

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    All,
    I have a file that has HEX A0 (Decimal 160) characters for spaces. I need to replace them with HEX 20 (decimal 32) characters.
    I can find them and reeplace them by doing something like this:
    Please Login or Register  to view this content.
    But what I would like to do is put in the value instead of using the string values, something like this:
    Please Login or Register  to view this content.
    Is there a way to do that?


    Thanks.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    You could do it like:
    Please Login or Register  to view this content.
    And
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    Solus,
    Thank you. What I am trying to avoid is using the " ", and having the value visible in the code.
    Is there a way to do that?

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    Char is not defined so I get a compile error.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    Replace Char with Chr. Or

    Please Login or Register  to view this content.
    Last edited by shg; 11-26-2013 at 12:39 PM.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    My mistake. Thanks shg.

  8. #8
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Need help with REPLACE function to replace HEX A0 with HEX 20 in string

    Success and solved, thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find a string by VBA Regular Expression and replace a part of that string
    By taps in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2013, 11:08 AM
  2. Replace variables in string and perform function
    By Jefferson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-02-2012, 07:53 PM
  3. Replies: 15
    Last Post: 07-05-2012, 12:49 PM
  4. Instr Function - Replace String 2 with Variables?
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2010, 03:14 PM
  5. Replace Function:Replace" and type in
    By ronnyc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2007, 06:26 PM

Tags for this Thread

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