+ Reply to Thread
Results 1 to 12 of 12

Spelling errors-a macro to prompt user if a word is similar to a list and replace it

Hybrid View

limebaish Spelling errors-a macro to... 01-26-2013, 09:47 PM
barryleajo Re: Spelling errors-a macro... 01-27-2013, 01:44 AM
limebaish Re: Spelling errors-a macro... 01-27-2013, 08:39 AM
barryleajo Re: Spelling errors-a macro... 01-27-2013, 10:07 AM
limebaish Re: Spelling errors-a macro... 01-27-2013, 10:30 AM
barryleajo Re: Spelling errors-a macro... 01-27-2013, 10:46 AM
limebaish Re: Spelling errors-a macro... 01-27-2013, 11:19 AM
barryleajo Re: Spelling errors-a macro... 01-27-2013, 03:23 PM
limebaish Re: Spelling errors-a macro... 01-27-2013, 03:55 PM
limebaish Re: Spelling errors-a macro... 01-27-2013, 03:45 PM
barryleajo Re: Spelling errors-a macro... 01-27-2013, 04:16 PM
limebaish Re: Spelling errors-a macro... 01-27-2013, 04:26 PM
  1. #1
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Hi everyone,

    I have a problem when users make spelling errors in a form as it messes up my checklists (for errors!). I have supplied an example worksheet which I hope you could take a look at. Essentially I would be very grateful for a macro that does the following:

    1. User enters word/phrase in column A
    2. Macro compares word/phrase to list of 'Correct spelling'
    3. If word/phrase is similar to one in the list then user is prompted with the following: "It looks like you have entered a [*****] expense. Correct phrasing/spelling?"
    4. If user selects yes then correct with the matching word/phrase (replace contents of A? with E?).
    5. If no then leave entry.

    If you think you can help with this then I really would be very grateful for your reply. This is also the sort of macro that many people would find useful so that forms can be standardised etc so feel free to comment yourself in - macro fame :D

    Potential solutions already considered:

    While spellcheck does work to an extent, it doesn't do quite what I have in mind (standard phrasing throughout). There's is also a potential solution of using wildcards so that any word the user enters which is similar to a word on my list will be at least noted by my various formulae. Unfortunately that also doesn't give the desired result for the same reason. Any amalgamation is welcome though!

    Thank you all in advance,

    Limebaish
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Why not use a combobox for the user to select the correct term from?
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

  3. #3
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Hi Barryleajo,

    Thanks for the suggestion - I've just had a look and it seems that this could be a decent workaround. While I know how to make a simple data validation list, I don't know what to change for my needs when I get to the VBA code here: http://www.contextures.com/xlDataVal10.html (just a quick google result- hope that's what you meant?). Just to clarify though, this range could have any number of words/phrases so I only really any sort of prompt if the input is similar to the 'correct spelling list'.

    Thank you and by all means keep the suggestions coming!

  4. #4
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Hello limebaish
    Have a look at the simple demo attached.
    This uses simple data validation directly on a worksheet but could just as easily be on a userform.
    Clicking in E7 gives the drop down list for the user to select from.
    No spelling checks required.
    The list is dynamic so just add more terms to the list on the Lists tab.
    When the value is selected I have just demonstrated a message box.
    This could be any event that that you choose depending on the selection.
    Hopefully, something for you to build on.

    Spelling replace macro demo.xlsm

  5. #5
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Hi Barryleajo,

    Thanks for you post and example workbook Unfortunately this isn't what I had in mind as I can't have a user adding to a dynamic range as well as selecting it from a drop down in an entry form. What I was really hoping for was an automated index+match/vlookup that gave me similar results and then checked with the user if that close match is what they wanted. If it was then the cell would be replaced with the standardised phrasing (which, to be clear is not applicable to all entries, just ones that are similar).

    Thanks for your help,
    Limebaish

  6. #6
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Hello limebaish
    I still don't quite understand the workflow.
    The idea is that you would control the master list, as "administrator" not the user.
    The list/worksheet could even be hidden from the user to prevent any confusion/ambiguity.
    If this route is a complete no-no then no worries.

  7. #7
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Hi Barryleajo,

    I'm really sorry if I haven't been clear enough on this, particularly as you've started writing some VBA for this. Perhaps if I clear this up you wouldn't mind having another look?

    Column A will be filled with entries of whatever the user chooses. No pattern to entries. I have a checklist that has only a specific number of entries that I am worried about checking, that I've put in another list. So while a column might have the names of anything else, I'm only concerned with the cells that match what I have on my list.

    However, people might misspell those entries so I would like a macro that checks the range against my list, finds similar matches and prompts the user, asking them if they meant to spell 'depreciation' properly etc, if they did then it will just replace the cell with the way I've spelled in on my list. Any non-matches should just be ignored (end sub).

    Please let me know if that's clear enough for you as I really appreciate your help

  8. #8
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Hello limebaish
    I have attached something for you to test that may help take you forward.


    Spelling replace macro v2.xlsm

  9. #9
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Just had a further look through the code and I can see what you've done (to an extent) and it is genius Am I right in thinking that if the word matches it to a certain given percentage then it is queried? That is fantastic :D

    Would you mind just doing me one more favour and making a second range so I can see how you would change the code for separate ranges (specifically named ranges so instead of A3:14 we could call it 'Mylist' and a second range to check 'Mylist2'. Thank you again, this is truly brilliant

  10. #10
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    WHAT VOODOO IS THIS? Haha wow that was incredible!

    Of course I would really appreciate it if you could talk me through these steps so that I can customise it for future use but what you have just made was exactly what I was hoping for. Thank you!

    So how do I add to the list of words to check for? How is it looking for misspelled words? This is going to be so useful!

  11. #11
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Many thanks limebaish
    I'll write up a brief explanation for you rather than cluttering up this thread.
    Just add further words to the lists in either/both cols A and col E.
    If this meets your requirement perhaps you would mark your thread as Solved.
    Barry

  12. #12
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Spelling errors-a macro to prompt user if a word is similar to a list and replace it

    Thank you very much Barry, I will of course put this one as solved!

+ 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