+ Reply to Thread
Results 1 to 3 of 3

changing letter case in cell

  1. #1
    Registered User
    Join Date
    04-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    40

    changing letter case in cell

    Hi guys, fairly simple one, yet it has me stumped.

    Trying to change my code to add another automatic function in my document. Here is the snippet of code involved:

    Please Login or Register  to view this content.
    Essentially what I would like to do is if text is entered into range L2:L* (where * is last row- LRow in my code) to have upper case. I have tried:

    Please Login or Register  to view this content.
    However the addition of line

    Target.Value = UCase(Target.Value)

    seems to send the function into a loop and can only be stopped by ESC.

    Please assist me as I really would like to have this function. I know it must be something simple that I am overlooking and your help will be greatly appreciated.
    Last edited by mpower87; 06-09-2010 at 02:44 AM. Reason: solved

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: changing letter case in cell

    You have to turn off OTHER macros when a ws_Change event is going to write to the worksheet itself, else it will trigger the ws_change macro all over again.

    Here's a much shorter version of your macro that will do both things you want.
    Please Login or Register  to view this content.

    Also, this version will work when you change MORE than one cell at a time, your original macro aborted if you put values in more than one cell at once.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-19-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    40

    Re: changing letter case in cell

    thanks for that Jerry, its working wonderfully! genius.

+ 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