Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 108
Default Restrictions in format

How do I restrict some columns of having all text in UPPER CASE, some columns
to have text only First In Capital Letter and some columns only in lower
case??

Thanks

JPG
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Restrictions in format

You can restrict using Data Validation but I would find that very annoying.

Example............in DVAllowCustom =EXACT(A1,UPPER(A1)) will not allow
anything but Uppercase.

I would use event code to automatically change Case when anything is
entered.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
If .Column = 1 Then
.Formula = UCase(.Formula)
End If
If .Column = 2 Then
.Formula = LCase(.Formula)
End If
If .Column = 3 Then
.Formula = Application.Proper(.Formula)
End If
End With
ErrHandler:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code". Copy/paste the code into that
sheet module.

Edit column numbers to suit.

Alt + q to return to Excel.


Gord Dibben MS Excel MVP

On Tue, 27 Apr 2010 08:07:01 -0700, juanpablo
wrote:

How do I restrict some columns of having all text in UPPER CASE, some columns
to have text only First In Capital Letter and some columns only in lower
case??

Thanks

JPG


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RESTRICTIONS YESHWANT JOSHI Excel Discussion (Misc queries) 5 May 26th 09 05:02 PM
How to use SMALL with certain restrictions? thscc1659 Excel Discussion (Misc queries) 3 September 18th 08 05:17 AM
Excel help and AD GPO restrictions javagirl Excel Discussion (Misc queries) 2 April 2nd 07 09:14 PM
How to do look up with restrictions JackR Excel Discussion (Misc queries) 3 April 3rd 06 01:12 AM
Restrictions to hyperlinks AndyOne Excel Discussion (Misc queries) 1 July 8th 05 08:41 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"