+ Reply to Thread
Results 1 to 3 of 3

Thread: Automatically capitalizing letters

  1. #1
    Registered User
    Join Date
    11-02-2007
    Posts
    74

    Automatically capitalizing letters

    Hi,

    I have a set of data whereby I have some VBA code in it where it will take text in a box and capitalize the first letter of each word. I now want to take that text and wherever the words 'click here' or 'click here now' are present in the text, I want to make them all capitals. As an example:

    To Learn About Excel Click Here Now!

    would automatically become:

    To Learn About Excel CLICK HERE NOW!


    Or:

    To Learn About Excel Click Here!

    would automatically become:

    To Learn About Excel CLICK HERE!


    I am not sure how to code this into the sheet. I have attached an example (Excel 2007) and appreciate any help

    Will
    Attached Files Attached Files

  2. #2
    Forum Guru mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    2,998

    Re: Automatically capitalizing letters

    Changing this one line should work.

    Target = Replace(Replace(StrConv(Target, vbProperCase), "Click Here Now", "CLICK HERE NOW"), "Click Here", "CLICK HERE")
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    11-02-2007
    Posts
    74

    Re: Automatically capitalizing letters

    Brilliant Mike, thanks so much, works perfectly

+ 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.2.0