PC Review


Reply
Thread Tools Rate Thread

Capitalise on Input Q

 
 
Seanie
Guest
Posts: n/a
 
      5th Dec 2010
How could I achieve the following when a user inputs data:-

In Col B capitalise the 2 digits after the first - (i.e. dash), note I
will have a second - (i.e dash) in the same cell but want to ignore
the 2nd one

In Col C & D capitalise the first letter that the user inputs

Thanks
 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      5th Dec 2010
Could you post some examples of the data that you expect to be input?

You can use PROPER to give you initial capital letters, like this:

=PROPER(C1)

but if you have more than one word in columns C and D then each inital
letter of each word will be capitalised. If you don't want this then a
formula like this can be used:

=UPPER(LEFT(C1)) & LOWER(RIGHT(C1,LEN(C1)-1))

Hope this helps.

Pete

On Dec 5, 8:39*am, Seanie <seanrya...@yahoo.co.uk> wrote:
> How could I achieve the following when a user inputs data:-
>
> In Col B capitalise the 2 digits after the first - (i.e. dash), note I
> will have a second - (i.e dash) in the same cell but want to ignore
> the 2nd one
>
> In Col C & D capitalise the first letter that the user inputs
>
> Thanks


 
Reply With Quote
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      5th Dec 2010
On Dec 5, 2:39*am, Seanie <seanrya...@yahoo.co.uk> wrote:
> How could I achieve the following when a user inputs data:-
>
> In Col B capitalise the 2 digits after the first - (i.e. dash), note I
> will have a second - (i.e dash) in the same cell but want to ignore
> the 2nd one
>
> In Col C & D capitalise the first letter that the user inputs
>
> Thanks

Right click the sheet tab>view code>insert this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 2 Then
Application.EnableEvents = False
fd = InStr(Target, "-")
ms = Left(Target, fd) & UCase(Mid(Target, fd + 1, 2)) _
& Mid(Target, fd + 3, 256)
Target = ms
Application.EnableEvents = True
End If
If Target.Column = 3 or target.column=4 Then
Application.EnableEvents = False
Target.Value = UCase(Left(Target, 2)) & _
Right(Target, Len(Target) - 2)
End If
Application.EnableEvents = True
End Sub
 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      5th Dec 2010
> In Col C & D capitalise the first letter that the user inputs

Change both the 2's to 1 in this part of Don's code.

>Target.Value = UCase(Left(Target, 2)) & _
>Right(Target, Len(Target) - 2)



Gord Dibben MS Excel MVP

On Sun, 5 Dec 2010 06:12:59 -0800 (PST), Don Guillett Excel MVP
<(E-Mail Removed)> wrote:

>> In Col C & D capitalise the first letter that the user inputs
>>
>> Thanks

>Right click the sheet tab>view code>insert this.
>
>Private Sub Worksheet_Change(ByVal Target As Range)
>If Target.Count > 1 Then Exit Sub
>If Target.Column = 2 Then
>Application.EnableEvents = False
>fd = InStr(Target, "-")
>ms = Left(Target, fd) & UCase(Mid(Target, fd + 1, 2)) _
>& Mid(Target, fd + 3, 256)
>Target = ms
>Application.EnableEvents = True
>End If
>If Target.Column = 3 or target.column=4 Then
>Application.EnableEvents = False
>Target.Value = UCase(Left(Target, 2)) & _
>Right(Target, Len(Target) - 2)
>End If
>Application.EnableEvents = True
>End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capitalise Richard Microsoft Excel Programming 6 7th Apr 2009 12:41 PM
Why don't UDFs capitalise properly when input on a worksheet? pinkfloydfan Microsoft Excel Programming 1 22nd Mar 2007 03:25 PM
Trying to Capitalise on Input to Cells John Microsoft Excel Worksheet Functions 3 23rd Jun 2006 03:18 PM
input mask to capitalise first letter of surname =?Utf-8?B?bWFyZG9o?= Microsoft Access 4 16th Nov 2005 11:04 PM
Input Mask - Capitalise First Letter ? andyw Microsoft Access 2 25th Oct 2004 05:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:48 PM.