Need uppercase and propercase when entered in cell

gibsongk55

Board Regular
Joined
Feb 15, 2010
Messages
61
Hi,

How can I use VBA to automatically set uppercase and propercase upon entry in cells.

This is what I need for the entire worksheet according to columns below:

Proper Case Columns C, F, J, K, M, N, O, Q

UPPER CASE Columns D, L, R

Thanks,

GIbs
 
Hi Again Trevor,

Yes i tried kpark's code like you said and that works fine also. Just not on those three columns like I said. I guess I need a work around because of the validation on those three columns.


Thanks,

Gibs
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Okay I got it all to work now.

To get around the list problem I changed all the colors in the list to low case.
This way it will validate and change to proper case automatically.

Thanks everyone for your help. It was much appreciated.


Gibs
 
Upvote 0
Please I need some more help. I had everything working but now when I enter data using the form it does not convert column F to upper case. Also the first four columns B through E all cells are empty after I entered data through the form.

VBA code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("K:K, M:M, R:R")) Is Nothing Then Target = UCase(Target)
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("C:C, D:D, F:F, G:G. H:H, I:I, J:J, O:O, Q:Q")) Is Nothing Then
Application.EnableEvents = False
Target = StrConv(Target, vbProperCase)
Application.EnableEvents = True
End If
On Error GoTo 0
End Sub

I have fields column B through R and one other vba routine to validate email.

Thanks for help.

Gibs
 
Last edited:
Upvote 0
I found that the problem is in my column F which has a list to validate only M,F allowable for entry. I have in vba to set it to upper case on that column. So when i type in "m" in that cell, the vba does not change it to upper case and it fails validation. After i manually retype the data in that cell to upper case "M" it clears out all the data entered in the four columns before it. But it still appeared in the data form before going to the next record.

Hope there is a way to fix this.

Thanks,

Gibs
 
Upvote 0

Forum statistics

Threads
1,224,519
Messages
6,179,263
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top