PC Review


Reply
Thread Tools Rate Thread

Change Case for Names

 
 
=?Utf-8?B?SmVmZg==?=
Guest
Posts: n/a
 
      16th Jun 2007
I have a data dump with names. Since the users inputs their name, the case
of the name varies. I would like to clean the names up to make them look
nice. For example, the names are typically one of these three:

Jeff (this is good)
jeff (not good)
JEFF (not good)

How can I clean them up so the first letter is always capital and the rest
are lower case?

I hope I can do this.. Thanks!
--
Jeff
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      16th Jun 2007
Try:

=Proper(a1)

Mike

"Jeff" wrote:

> I have a data dump with names. Since the users inputs their name, the case
> of the name varies. I would like to clean the names up to make them look
> nice. For example, the names are typically one of these three:
>
> Jeff (this is good)
> jeff (not good)
> JEFF (not good)
>
> How can I clean them up so the first letter is always capital and the rest
> are lower case?
>
> I hope I can do this.. Thanks!
> --
> Jeff

 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      16th Jun 2007
you didn't mention where the data was, but if you want to use vba to correct the
case, try this

Range("A1") = Application.Proper(Range("a1"))

--


Gary


"Jeff" <(E-Mail Removed)> wrote in message
news54ECD69-3ACF-4F49-ABCB-(E-Mail Removed)...
>I have a data dump with names. Since the users inputs their name, the case
> of the name varies. I would like to clean the names up to make them look
> nice. For example, the names are typically one of these three:
>
> Jeff (this is good)
> jeff (not good)
> JEFF (not good)
>
> How can I clean them up so the first letter is always capital and the rest
> are lower case?
>
> I hope I can do this.. Thanks!
> --
> Jeff



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      16th Jun 2007
And VBA has its own built-in function, too.

See StrConv in VBA's help for more info.

Gary Keramidas wrote:
>
> you didn't mention where the data was, but if you want to use vba to correct the
> case, try this
>
> Range("A1") = Application.Proper(Range("a1"))
>
> --
>
> Gary
>
> "Jeff" <(E-Mail Removed)> wrote in message
> news54ECD69-3ACF-4F49-ABCB-(E-Mail Removed)...
> >I have a data dump with names. Since the users inputs their name, the case
> > of the name varies. I would like to clean the names up to make them look
> > nice. For example, the names are typically one of these three:
> >
> > Jeff (this is good)
> > jeff (not good)
> > JEFF (not good)
> >
> > How can I clean them up so the first letter is always capital and the rest
> > are lower case?
> >
> > I hope I can do this.. Thanks!
> > --
> > Jeff


--

Dave Peterson
 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      16th Jun 2007
forgot about that one, thanks, dave.

--


Gary


"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> And VBA has its own built-in function, too.
>
> See StrConv in VBA's help for more info.
>
> Gary Keramidas wrote:
>>
>> you didn't mention where the data was, but if you want to use vba to correct
>> the
>> case, try this
>>
>> Range("A1") = Application.Proper(Range("a1"))
>>
>> --
>>
>> Gary
>>
>> "Jeff" <(E-Mail Removed)> wrote in message
>> news54ECD69-3ACF-4F49-ABCB-(E-Mail Removed)...
>> >I have a data dump with names. Since the users inputs their name, the case
>> > of the name varies. I would like to clean the names up to make them look
>> > nice. For example, the names are typically one of these three:
>> >
>> > Jeff (this is good)
>> > jeff (not good)
>> > JEFF (not good)
>> >
>> > How can I clean them up so the first letter is always capital and the rest
>> > are lower case?
>> >
>> > I hope I can do this.. Thanks!
>> > --
>> > Jeff

>
> --
>
> Dave Peterson



 
Reply With Quote
 
=?Utf-8?B?U2hhbmVEZXZlbnNoaXJl?=
Guest
Posts: n/a
 
      16th Jun 2007
Hi Jeff,

A little more detail:

Sub Conv()
For Each cell In Selection
cell.Value = StrConv(cell, 3)
Next cell
End Sub

Cheers,
Shane Devenshire


"Jeff" wrote:

> I have a data dump with names. Since the users inputs their name, the case
> of the name varies. I would like to clean the names up to make them look
> nice. For example, the names are typically one of these three:
>
> Jeff (this is good)
> jeff (not good)
> JEFF (not good)
>
> How can I clean them up so the first letter is always capital and the rest
> are lower case?
>
> I hope I can do this.. Thanks!
> --
> Jeff

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      16th Jun 2007
> A little more detail:
>
> Sub Conv()
> For Each cell In Selection
> cell.Value = StrConv(cell, 3)


I always find using the built-in VB constants makes reading a statement
easier...

cell.Value = StrConv(cell, vbProperCase)

Rick


> Next cell
> End Sub


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      17th Jun 2007
I prefer to not change any formulas in the selection to values.

cell.Formula = StrConv(cell, vbProperCase)


Gord Dibben MS Excel MVP

On Sat, 16 Jun 2007 15:56:39 -0400, "Rick Rothstein \(MVP - VB\)"
<(E-Mail Removed)> wrote:

>> A little more detail:
>>
>> Sub Conv()
>> For Each cell In Selection
>> cell.Value = StrConv(cell, 3)

>
>I always find using the built-in VB constants makes reading a statement
>easier...
>
> cell.Value = StrConv(cell, vbProperCase)
>
>Rick
>
>
>> Next cell
>> End Sub


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      17th Jun 2007
oops

Meant to post this instead.

cell.Formula = Application.Proper(cell.Formula)


Gord

On Sat, 16 Jun 2007 17:21:49 -0700, Gord Dibben <gorddibbATshawDOTca> wrote:

>I prefer to not change any formulas in the selection to values.
>
>cell.Formula = StrConv(cell, vbProperCase)
>
>
>Gord Dibben MS Excel MVP
>
>On Sat, 16 Jun 2007 15:56:39 -0400, "Rick Rothstein \(MVP - VB\)"
><(E-Mail Removed)> wrote:
>
>>> A little more detail:
>>>
>>> Sub Conv()
>>> For Each cell In Selection
>>> cell.Value = StrConv(cell, 3)

>>
>>I always find using the built-in VB constants makes reading a statement
>>easier...
>>
>> cell.Value = StrConv(cell, vbProperCase)
>>
>>Rick
>>
>>
>>> Next cell
>>> End Sub


 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      17th Jun 2007
>>> A little more detail:
>>>
>>> Sub Conv()
>>> For Each cell In Selection
>>> cell.Value = StrConv(cell, 3)

>>
>>I always find using the built-in VB constants makes reading a statement
>>easier...
>>
>> cell.Value = StrConv(cell, vbProperCase)
>>

>I prefer to not change any formulas in the selection to values.
>
> cell.Formula = StrConv(cell, vbProperCase)


Actually, I wasn't commenting on the technique that Shane posted, only his
use of a "magic number". VBA has an enormous amount of predefined constants
available for the programmer and my personal preference is to use them over
their numerical values. The name of these constants are usually
self-documenting making reading and/or changing one's code much easier in
later coding sessions.

Rick

 
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
How do I change the case on all my file names? =?Utf-8?B?TG93ZXIgQ2FzZSBEaWxlbW1h?= Microsoft Word Document Management 1 2nd Sep 2006 09:27 PM
How to change all file names to lower case? Joe Windows XP General 4 10th Jan 2005 08:53 PM
Re: Change Case-Folder Names monkeyjob Windows XP General 0 22nd Jun 2004 09:33 PM
Change Case-Folder Names Kathleen Windows XP General 1 9th Jun 2004 07:51 PM
Change upper case file names to lower case Sylvain Windows XP Help 0 11th Nov 2003 09:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:15 AM.