+ Reply to Thread
Results 1 to 7 of 7

Macro to Automatically Find/Replace

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    La Crosse, WI
    MS-Off Ver
    Excel 2010
    Posts
    70

    Macro to Automatically Find/Replace

    Hi there, I'm hoping that this is an easy fix...Currently I am working with Excel 2010 and am trying to find a way that when the letters "Ca" are typed the word will Automatically change to "Caliper", I have to do this with other measuring devices such as "V" to "Vision", "M" to "Mircometer", "T" to "Thread Gage", "R" to "Ring Gage", and "G" to "Gage Pin". Is there a Macro that can accomplish this?

    Regards,
    Cansa

  2. #2
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Belfast, N. Ireland
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Macro to Automatically Find/Replace

    Hi Cansa,

    Would it be possible to post an example of your worksheet, preferably with a before format and after format somewhere? This helps forum members see things such as which column or row the data to be changed will be.

    My initial thoughts are that it could be done by a few methods. If it is a new sheet as yet unpopulated then Data Validation may be the way to go, if it is an existing sheet which is already populated with data then it is a different approach.

    Mowgli

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    La Crosse, WI
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Macro to Automatically Find/Replace

    Okay sounds good, the column H is the column where they would enter in the letter, and the autofill would need to finish the word. They enter the information in row by row. I've tried to do this using the autocorrect and adding the letters to the list, but unforutnately that effects the entire document instead of just column H.

    Thanks for looking into this!
    Cansa

    Inspection Report - Formatting Project Master Copy.xlsx

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

    Re: Macro to Automatically Find/Replace

    For something like this, it would be easiest to Add a text entry to the AutoCorrect list

    Add a text entry to the AutoCorrect list
    1. Click the File tab.
    2. Click Options.
    3. Click Proofing.
    4. Click AutoCorrect Options.
    5. On the AutoCorrect tab, make sure the Replace text as you type check box is selected.
    6. In the Replace box, type a word or phrase that you [want replaced] — for example, type Ca.
    7. In the With box, type the [replacement] of the word — for example, type Caliper.
    8. Click Add.
    9. Repeat for all items you want auto-corrected.
    10. Click OK.
    Hope that helps,
    ~tigeravatar

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

  5. #5
    Registered User
    Join Date
    06-28-2012
    Location
    India Pune
    MS-Off Ver
    Excel 2003
    Posts
    17

    Smile Re: Macro to Automatically Find/Replace

    Hi Cansa,
    Please find the attachement which is replacing the letters to word.

    Book1 to replace.xls

  6. #6
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Belfast, N. Ireland
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Macro to Automatically Find/Replace

    Cansa,

    I gave 2 options. If you type the first letter, or Ca in the case of Caliper, and press return or tab it will automatically replace the contents of that cell with the correct name. Also, in row 19 I have included a drop down bow using data validation linked to the list I have typed in Coumn R. to remove the drop down box you can just copy a blank cell over the top of it, or to replicate it you can copy it into blank cells.

    Neither of these are exactly what you asked for I know but if they do not suit then am sure a more learned member of the forum would be able to help out more

    Inspection Report - Formatting Project Master Copy RevA.xlsm

  7. #7
    Registered User
    Join Date
    09-20-2012
    Location
    La Crosse, WI
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Macro to Automatically Find/Replace

    Dear Mowgli,

    Your Macro is AMAZING! thank you again for the help, its perfect

    Cansa

+ 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