+ Reply to Thread
Results 1 to 12 of 12

Replace slash sign to dash sign

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Replace slash sign to dash sign

    Hi friends,

    Greetings from me!

    In column there are phone numbers. The digits are not fixed. I want the user to use dash sign to separate country code, std code, area code and phone number with dash sign only. But sometimes some users uses slash sign to separate it which I don’t want. If the user used slash sign to separate it then I want to change the slash sign to dash sign automatically after hiding the enter key. The column is formatted as ‘Text’. In short I don’t want any other sign except dash sign to separate the digits.

    Any help will be highly appreciated.

    Thanking you in anticipation.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Help request to replace slash sign to dash sign

    Hello mso3,

    Place the Code below in a Standard Module;

    Please Login or Register  to view this content.
    Try the attachment.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Replace slash sign to dash sign

    try this:
    format the cells in wrap text and fill the formula as:
    H1 = =SUBSTITUTE(G1,"/","-")

  4. #4
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Replace slash sign to dash sign

    Hi Winon,
    Perfect! Thank you. Can we make it automatic b inserting the code in sheet module? So that after entering the phone number after changing the cell the slash will be automatically change to dash. If not possible then leave it; I will mark the thread solved.

    Thank you and have a nice time.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Replace slash sign to dash sign

    Thank you for the feedback mso3,

    Delete all the Code and Buttons from my sample attachment, then in the relevant Sheet enter the Code below:

    Please Login or Register  to view this content.
    Enjoy!

    Regards.

  6. #6
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Replace slash sign to dash sign

    Hi Winon,

    Thank you for taking trouble for me. It's not working as per requirement. Please see the attached workbook and suggest me where I'm wrong.

    Thanking you.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace slash sign to dash sign

    See if this does what you require.
    Attached Files Attached Files

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Replace slash sign to dash sign

    Hi mso3,

    JOHN H. DAVIS was faster than me! Gonna kill him for that!LOL

    You may delete the Calculation Code and only use what he has added. So you will only be using the Code below!

    Please Login or Register  to view this content.
    @JOHN H. DAVIS,

    Stop Hi-Jacking my Threads!

    Thank you for you helping out here!

    Regards.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace slash sign to dash sign

    @ Winon - Sorry about that, thought you might have been a bit busy!!

  10. #10
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Replace slash sign to dash sign

    Hi Winon.

    Please don't be angry. We all are friends helping each other.

    Thank you. Now it's working fine.

    Hi John,
    Thank you. It's working fine.

    I appreciate you both for your kind assistance to solve my problem.

    Thank you and have a nice time.

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Replace slash sign to dash sign

    Hi mso3,

    Please don't be angry.
    I am 100% certain that JOHN H. DAVIS is not offended, and he knows that I was only jerking his chain!

    Adding a bit of humor lighten things up a bit, don't you think?

    You are welcome, glad we could help you, and thank you for the REP!

    Regards.

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace slash sign to dash sign

    @ Winon - Not offended at all.

    @ mso3 - Myself and some other posters joke around a lot on the Forum. So it's just part of having fun here. BTW thanks for the feedback and reps.

+ 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] How to Search on 3 Dash Sign?
    By putritersenyum in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-14-2016, 10:36 AM
  2. [SOLVED] Insert dash sign where not
    By makinmomb in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-18-2015, 06:07 AM
  3. [SOLVED] Help require to have a dash sign in the table
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-15-2015, 01:03 AM
  4. [SOLVED] Ignore dash sign while concatenate
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2013, 07:05 AM
  5. [SOLVED] code to insert dash sign
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 07-06-2013, 11:01 PM
  6. I see a dash, Excel sees a minus sign.
    By vishorizons in forum Excel General
    Replies: 3
    Last Post: 11-09-2009, 11:02 AM
  7. XL invoice replace the dollar sign with euro sign
    By Pamela casares in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-16-2005, 04:25 PM

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