+ Reply to Thread
Results 1 to 4 of 4

remove underscore if there is one

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Calgary,Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    remove underscore if there is one

    Hello experts,

    I'm fairly new to vba and programming in general, sorry if this seems trivial
    I just need something that will remove an underscore in a string if there is one. Not sure if after removing the underscore, it will be replaced by space, if that's the case, I need to collapse the string together so there's no spaces present.
    ex: "WILLIAM_ABERHART" to "WILLIAMABERHART"

    Thank you for your time,

    Hallet

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: remove underscore if there is one

    Replace("WILLIAM_ABERHART", "_", "")

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: remove underscore if there is one

    Hallet,

    Formula solution:
    Please Login or Register  to view this content.

    VBA solution:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    05-09-2012
    Location
    Calgary,Canada
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: remove underscore if there is one

    Thanks very much!

+ 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