automatically change text case on entry

I use the following code to automatically change the case of a range of cells 
to uppercase in Excel, which works fine.

However I need some other cells in the same sheet to automatically change to 
Proper Case.  Is there a way of adapting the following code to enable upper 
and proper case?

Private Sub Worksheet_Change(ByVal Target As Range)

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    If Not Intersect(Target, Range("H1,M5,O11,F7")) Is Nothing Then
        With Target
            .Value = UCase(.Value)
        End With
    End If

ws_exit:
    Application.EnableEvents = True
End Sub
0
7/14/2005 8:56:09 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
386 Views

Similar Articles

[PageSpeed] 19

One way:

    Private Sub Worksheet_Change(ByVal Target As Range)
        On Error GoTo ws_exit:
        Application.EnableEvents = False
        If Not Intersect(Target, Range("H1,M5,O11,F7")) Is Nothing Then
            With Target
                .Value = UCase(.Value)
            End With
        ElseIf Not Intersect(Target, Range("A1,B2,J10")) Is Nothing Then
            With Target
                .Value = Application.Proper(.Value)
            End With
        End If
    ws_exit:
        Application.EnableEvents = True
    End Sub


In article <0B4CE16D-C17F-46C2-AD42-B041C5299005@microsoft.com>,
 "John Davies" <JohnDavies@discussions.microsoft.com> wrote:

> I use the following code to automatically change the case of a range of cells 
> to uppercase in Excel, which works fine.
> 
> However I need some other cells in the same sheet to automatically change to 
> Proper Case.  Is there a way of adapting the following code to enable upper 
> and proper case?
> 
> Private Sub Worksheet_Change(ByVal Target As Range)
> 
>     On Error GoTo ws_exit:
>     Application.EnableEvents = False
>     If Not Intersect(Target, Range("H1,M5,O11,F7")) Is Nothing Then
>         With Target
>             .Value = UCase(.Value)
>         End With
>     End If
> 
> ws_exit:
>     Application.EnableEvents = True
> End Sub
0
jemcgimpsey (6723)
7/14/2005 12:30:20 PM
Hi JE McGimspey

That works fine.  Thanks for your help

"John Davies" wrote:

> I use the following code to automatically change the case of a range of cells 
> to uppercase in Excel, which works fine.
> 
> However I need some other cells in the same sheet to automatically change to 
> Proper Case.  Is there a way of adapting the following code to enable upper 
> and proper case?
> 
> Private Sub Worksheet_Change(ByVal Target As Range)
> 
>     On Error GoTo ws_exit:
>     Application.EnableEvents = False
>     If Not Intersect(Target, Range("H1,M5,O11,F7")) Is Nothing Then
>         With Target
>             .Value = UCase(.Value)
>         End With
>     End If
> 
> ws_exit:
>     Application.EnableEvents = True
> End Sub
0
7/15/2005 7:42:02 AM
Reply:

Similar Artilces:

I want to unlock my word doc to make changes its protected
I am writing a word document the other night. I went to carry on with it tonight but found it has protected the document and won't let me continue writing or editing Word 2007? Assuming that you have activated Office, it seems your trial version of the application has expired. Time to pay the piper! -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> ...

Changing SQL Server for CRM 1.2
As my SQL server is currently on its last breath I am in the process of moving our CRM 1.2 databases to a new dedicated serever. I have detatched the databases from the old server, copied the files to the server and attached them. I have then gone into CRM deployment manager and changed to the SQL server to the new server. That all appears to work fine, no error messages. But when users try to access the CRM system they get an error and the CRM server event log fills with error messages. A few are listed below: dmLog: Failed to execute the SQL batch in the file sqlbatch.sql. MSCRM P...

Territory Change
Our Sales VP has restructured all of the geographical territories that we had set up in Microsoft CRM. Our many thousands of Accounts are associated with territories. Obviously it is ludicrous to think that we would have to go one by one and change the territory on each account to the new territories. However, I have heard that there are strict rules for making changes directly to the backend SQL database. If we develop a SQL statement to change the territories assigned to each account to the new territories, are we going to be breaking anything? We don't want to screw up any de...

chart MAcro to change on activecell
Here is the macro below.. The only problem is that the columns change every month. so range (columns)keeps widening.... I have sorted it by selecting range upto column N. so it is provided for all 12 months. But now the "Grand total" column which is always the last column also gets included..(.which shouldnt be included in the range for the chart) Is there a way to modify this macro ? Sub updatechart1() Dim ThechartObj As ChartObject Dim Thechart As Chart Dim Userrow As Long Dim CatTitles As Range Dim SrcRange As Range Dim SourceData As Range If Sheets("summary").Ch...

Changing font in Money 2004 register?
Is there any way to change the font(s) used in MS Money 2004's registers? The default font is too small and difficult for me to read. Also, is there any way to change the color scheme to something more pleasing to my eye (like you can do in Quicken...) Thanks. Nope and Nope. See http://umpmfaq.info/faqdb.php?q=136. "Debbie R." <debbimsr@bellsouth.net> wrote in message news:f5ff01c43e15$e2ae3700$a401280a@phx.gbl... > Is there any way to change the font(s) used in MS Money > 2004's registers? The default font is too small and > difficult for me to read....

VBA to creating autotext entries or quickparts in different catego
I have a VBA application that basically allows people to easily create autotext entiries, move them between machines and use them making comments on assignments. Currently it operates in EXACTLY the same way in Word 2003 and 2007 (using userforms) and I want to keep that as long as possible. You can see the application at http://emarking-assistant.baker-evans.com and either the screen image or the video demos will give you an idea of what I am doing Currently I store all the comments in a long list of autotext entries that is displayed in a field with the value of the entr...

Joining text with a formula in cell #4
just to complete the thread... I found the answer. You have to change the format of the cell to custom 0.00"*" this is the only way it will show only 2 decimal places Thanks for the hel -- Mustard Hea ----------------------------------------------------------------------- Mustard Head's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1630 View this thread: http://www.excelforum.com/showthread.php?threadid=27700 ...

changing values of one field based on another
How can I best change the values of one field in a table based on values of another field of the same table. We have an existing table of thousands of entries and I would like to use the following logic to populate a new boolean field. If field1 = "Done" Then BooleanFieldCompleted = True I have some Excel VBA experience but limited Access. I dont want to do this manually! Any assistance appreciated. In general, you'd use an Update query. However, in this case I don't see why you'd need such a field. Why not just create a query with a computed field that returns True...

Change the Exchange Virtual Directory to different website
I would like to remove the exchange virtual directory default website and move it another website which is currently redirecting to the website I want to delete. Meaning rather than logon to OWA as http://www.wheresmylunch.com/exchange (current default website) I want to move to http://www.getyourownsandwich,com/exchange. I am using Exchange 2000 server. Rube You would change the host header on the current website. -- Hope that helps, Dan Townsend This posting is provided "AS IS" with no warranties, and confers no rights. Please do not send email to this address, post a reply t...

Receiving Transaction Entry #2
I went into Receiving Transaction Entry to record the receipt of an item. The invoiced price did not agree with the purchase order. I had to add Shipping and adjust the provincial tax. I went to the proper screen to over-ride the calculated tax and the system told me that I couldn't do that because I had not filled in all the BOLD, RED areas. At that point I wanted to close down that screen, but the system would not let me do that either. I could minimize the screen and then I could also see that there wasn't any required information that had not be entered. The only way I c...

Money 2000 Account Balance Changed Inexplicably
Opening Money 2000, which I've used without problem since late 1999, I noticed that my checking account balance was overstated by almost $2000! I went to the register to see if there was a false transaction entered and it appears that this balance change goes back years with no obvious single entry being the culprit. When I run the "balance this account" function, it shows that the closing balance from my last statement, which was correct and rectified, is now also wrong and reflects the higher balance. What do I do now? The only thing that I can think of is to restore...

parameter for text
In Access 2003. In a form I have a parameter to search for a word at a a time Like [Froms].[Form].txtWords]&"*" which works well. .. In order to enter more than two oarameter separated by commas in txtwords I have been tryin the Str function like this "Instr([txtWords])" "Instr[txtWords]" The query displays no records at all. Could you suggest me how to do it Many thanks I would suggest separating by space and using this -- Like "*" & [Froms].[Form].txtWords] &"*" Remember that when you type in 'bell...

How do I bind a XAML text box control to a dataset?
Hello; I am new to using WinFx and I am having trouble figuring out how to bind a text box to a field in a dataset. I found an MSDN article: http://msdn2.microsoft.com/en-us/library/ms752057.aspx My question deals with the text box code: <TextBlock Text="{Binding Path=ISBN}" Grid.Column="1" /> How does this text box know to bind to the field "ISBN" in "myDataSet"? How does the control implement the dataset? Thank you Monty ...

Creating Text Box in Publisher 2007 Crashes the Application
Hello, we have a clean install of Publisher 2007 under Windows XP SP2, and when we try to create a text box in a document, (both an existing document and a blank document), publisher crashes. Office is fully patched. I ran Office Diagnostics from the help menu and no problems were found and the issue persists. Any thoughts on how to resolve the issue? Thanks, Syd See if selecting a different printer as default helps. How to view error signatures if an Office program experiences a serious error and quits http://support.microsoft.com/kb/289508/en-us -- Mary Sauer MSFT MVP http://of...

Changing language
I am running the Swedish version of Excel for XP and I need the US (or English) version. Is there a way to convert the language and all the settings associated with it? Using the swedish version is rather annoying since the formula names are translated to swedish. Thank you, Magnus ...

With and import tool can you change only item description?
Is there a way to change only the item description on a large quanity of items. What about the extended description? Thanks for your help. Use the MS SQL Data Import Tool by EMS. $65.00. The QSImport Tool available to download from Microsoft will probably work but is not supported by Microsoft. Kinnard L. Kohler Business Machines Systems 6101 South Shackleford Road Little Rock, AR 72204-8606 (T) 501-375-8380 (F) 501-375-0043 (Cell) 501-412-5686 Email: kinnard@removebmsar.com "Lisa" wrote: > Is there a way to change only the item description on a large quanity of >...

Changing a profile on Microsoft Outlook 2003
I set up two profiles through the control panel and directed Outlook to prompt me for which profile to use each time it was opened. But now it skips the prompt and goes straight to one of the profiles. I need to restore that prompt, but it won't respond to the instructions in the control panel Mail dialogue box Hi Chris, did you get the same behavior after a restart of the computer? You could try "Sart/run/fixmapi.exe" (you don�t get any confirmation message) and restart the computer again. If this wouldn�t wotk, I would create a 3rd (test) profile. Maybe Outlook don�t ...

Macro to change default setting on startup
I am in need of a macro that can change a default setting in excel and for it to run on startup The task is: Tools Options General Web Options Files uncheck Update links on save Below is the recording of the macro: With ActiveWorkbook.WebOptions ..RelyOnCSS = True ..OrganizeInFolder = True ..UseLongFileNames = True ..DownloadComponents = False ..RelyOnVML = False ..AllowPNG = False ..ScreenSize = msoScreenSize800x600 ..PixelsPerInch = 96 ..Encoding = msoEncodingWestern End With With Application.DefaultWebOptions ..SaveHiddenData = True ..LoadPictures = True ....

Selecting the Right Text Alignment for a edit box doesn't work
When I select right text alignment in the edit control properties, the text is still left aligned when I run the program. What am I doing wrong Thanks Dan Dan, "Dan" <anonymous@discussions.microsoft.com> a �crit dans le message de news:DECFE605-A130-416B-9924-60BA0C79D684@microsoft.com... > When I select right text alignment in the edit control properties, the text is still left aligned when I run the program. What am I doing wrong? > I've no idea :-))) You can open your RC-file as text, and make sure it has the ES_RIGHT style set, thus: EDITTEXT IDC...

Excel Text Function (Right, Left)
My sheet has columns like this A 1. 63mmx 4kg 2. 75mmx 4kg SWR How can i detect that if a1:a2 is right,3 "swr", that it should be returned 3 otherwise 6. How can i add =right function with conditional formula. Help me Rao Ratan singh Hi =IF(RIGHT(A1,"SWR"),3,6) fill down your column (move cursor over bottom right hand corner of the cell when you see a +, double click) -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Rao Ratan Singh" <RaoRatanSingh@discussions.microsoft.com> wrote in message news:D...

Changing the words "Sales Receipt" to "Invoice"
I cannot find how to change the word at the top right of our Sales document to read "Invoice" rather than "Sales Receipt". We bill out as a receivable for most of our goods and there seems to be some confusion with our customers. Thanks in advance for your help. -- Ron Moore Changing Sales Order to Invoice There is a receipt variable called "Transaction.ReceiptTransactionName" (in <SUB name="PrintTransactionType"> of receipt.xml)which returns the "default" name for the transaction based on it's type. You can replace this w...

SOP Sales Transaction Entry Window
Dear Folks, I have noticed that i couldn't choose/select a salesman Id from Sales Transaction Entry Window (Transactions-> Sales -> Sales Transaction Entry). In my case for every Invoice i have to select a Diffierent Sales man ID. Could any one help me how can i enable this. BUT IT IS AVAILABLE IN Transaction Entry Window which we use without inventory module (Transactions-> Sales -> Transaction Entry Window) Awaiting for your favourable feedback. You can find that field by clicking on the customer number expansion button to the right of the customer number field. Thi...

Automatically open Detail Entry Window
In SOP Transcation Entry, I'd like the Sales Customer Detail Entry window to open automatically after the customer ID is selected. Is this possible? How would I go about doing this with Modifier or VBA? Extender would come in very handy. You don't need to write a single code. Record a macro using GP macro and embed it on the SOP Entry window using Extender. "Elaine" wrote: > In SOP Transcation Entry, I'd like the Sales Customer Detail Entry window to > open automatically after the customer ID is selected. Is this possible? How > would I go about doi...

Text box in Embedded chart is cut off
Hi. I am having a problem with an embedded chart that appears differently in word versus how it appeared originally in Excel. Specifically, the top of the chart (in excel) has a text box that divides the chart (it is a vertical bar graph) into subcategories (labels at the bottom are used to specify what each bar signifies; but these are taken from the associated cell range). Originally, the chart was labeled by a single text box, separated by spaces: Lifetime Use 30-Day Use Heavy Use Antisocial Behavior When this chart is linked in word, the text displays like this (tho&...

Change View
Hi I have in a default view: My Active Accounts and I would like to change it to: Active Accounts Thanks Carlos Hi Carlos, This can be setup in the Account entity. Customize the Account Entity - forms and Views - Select Active Accounts and Set as default. This should do it. Hope this helps! Sam _______________ Inogic Innovative Logic Innovative solutions for your SME ERP/CRM products E-mail: crm@inogic.com Web: www.inogic.com -------------------------- "Carlos De la Cruz" <carlos.delacruz@gmail.com> wrote in message news:F19899E7-A9EB-4F38-BE4C-BA01991CD2C0@micro...