+ Reply to Thread
Results 1 to 14 of 14

formula to copy only capitalized WORDS from a cell

  1. #1
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    formula to copy only capitalized WORDS from a cell

    as simple as I can explain, If Cell A2 contains carrot MANGO banana , I want MANGO to be copied to cell B2.
    Thanks.

  2. #2
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: formula to copy only capitalized WORDS from a cell

    Somemore sample data would be helpful if you could supply it?
    How many words are going to be in each cell?
    Is there a pattern on how they are displayed in the cell?
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: formula to copy only capitalized WORDS from a cell

    Try the following User Defined Function (UDF):

    Please Login or Register  to view this content.

    User Defined Functions (UDFs) are very easy to install and use:

    1. ALT-F11 brings up the VBE window
    2. ALT-I
    ALT-M opens a fresh module
    3. paste the stuff in and close the VBE window

    If you save the workbook, the UDF will be saved with it.
    If you are using a version of Excel later then 2003, you must save
    the file as .xlsm rather than .xlsx

    To remove the UDF:

    1. bring up the VBE window as above
    2. clear the code out
    3. close the VBE window

    To use the UDF from Excel:

    =capsonly(A1)

    To learn more about macros in general, see:

    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    and

    http://msdn.microsoft.com/en-us/libr...ffice.14).aspx

    and

    http://www.cpearson.com/excel/Writin...ionsInVBA.aspx

    for specifics on UDFs

    Macros must be enabled for this to work!
    Gary's Student

  4. #4
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: formula to copy only capitalized WORDS from a cell

    here is a sample file.I want to be automated to extract capitalized letters to column B once capital letters are entered in any cell in column A
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: formula to copy only capitalized WORDS from a cell

    I tried running the macro. See what i got
    Attached Images Attached Images

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: formula to copy only capitalized WORDS from a cell

    You must insert a module and put the UDF in that module. See the attached


    Remember to enable macros!
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: formula to copy only capitalized WORDS from a cell

    Thank you sir! you're just perfect!

  8. #8
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: formula to copy only capitalized WORDS from a cell

    You are quite welcome!

  9. #9
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: formula to copy only capitalized WORDS from a cell

    Actually am marveled by the fast response. I was really afraid if my problem was solveable.

    Alright... what if I want to copy lowercase words to column c? guess I should add another module but don't know the variables to change in the macro to suit this purpose.
    Thanks

  10. #10
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: formula to copy only capitalized WORDS from a cell

    Just another UDF in the same module. See attached:
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: formula to copy only capitalized WORDS from a cell

    That was fantastic ! but a problem sir . I would want it to also want to extract words that begin with capital letters only.. Will be useful for me in extracting names of people.

    sorry I only post when I see a need for a new feature.
    Thanks

  12. #12
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: formula to copy only capitalized WORDS from a cell

    See the attached:
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    12-14-2013
    Location
    edo,nigeria
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: formula to copy only capitalized WORDS from a cell

    lack words to express my appreciation

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: formula to copy only capitalized WORDS from a cell

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Extract Capitalized Words From String
    By jaslake in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-12-2010, 07:26 PM
  2. Copy Words from one cell to the other (w/o macro)
    By zpphillips in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-11-2010, 11:37 AM
  3. [SOLVED] CAPITALIZED ALL WORDS FROM WROKSHEET
    By convert all capital letter from excel in forum Excel General
    Replies: 2
    Last Post: 05-01-2006, 08:45 AM
  4. [SOLVED] copy/paste words in cell can't be read on screen
    By MO in forum Excel General
    Replies: 2
    Last Post: 04-28-2006, 10:55 AM
  5. Replies: 2
    Last Post: 10-05-2005, 06:05 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