Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Change Case for Names

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change Case for Names

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Change Case for Names

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" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Change Case for Names

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" wrote in message
...
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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Change Case for Names

forgot about that one, thanks, dave.

--


Gary


"Dave Peterson" wrote in message
...
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" wrote in message
...
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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,344
Default Change Case for Names

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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Change Case for Names

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


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Change Case for Names

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\)"
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


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Change Case for Names

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\)"
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


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Change Case for Names

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
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
can I change the cap letters of student names to lower case user Excel Discussion (Misc queries) 2 May 28th 10 01:42 AM
change data of entire column from small case to upper case Ann Excel Worksheet Functions 1 August 16th 08 01:06 PM
How do I change the case from all caps to proper for names I have in columns E, F, G? duugg Excel Discussion (Misc queries) 22 April 26th 06 01:25 PM
Change the text from lower case to upper case in an Excel work boo dave01968 Excel Discussion (Misc queries) 2 December 9th 05 09:09 AM
How to use formula auditing to change upper case to Title Case. ScoobeyDoo Excel Worksheet Functions 1 November 19th 04 06:26 PM


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

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

About Us

"It's about Microsoft Excel"