Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Setting up capitalization after hyphens

Hi all:

I have a spreadsheet which lists 20,000 last names - all in lower
case. Some of these last names are hyphenated -- "smith-jones".

I would like to automatically capitalize the first letter and the
letter after the hyphen.

I can do the former using ASAP Utilities (a great plug-in!) but
haven't a clue as to how I capitalize the first letter after the
hyphen.

Any ideas on what to do?


Thanks,
SB
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Setting up capitalization after hyphens

smith-jones in A1

=PROPER(A1) in B1 returns Smith-Jones

Is that what you want?

A macro would do the job without the formulas.

Sub Proper_Case()
Dim rng As Range
Set rng = Nothing
On Error Resume Next
Set rng = Selection.SpecialCells(xlCellTypeConstants)
On Error GoTo 0
If rng Is Nothing Then
Else
rng.Formula = Application.Proper(rng.Formula)
End If
End Sub


Gord Dibben MS Excel MVP

On Mon, 3 Mar 2008 14:01:06 -0800 (PST), wrote:

Hi all:

I have a spreadsheet which lists 20,000 last names - all in lower
case. Some of these last names are hyphenated -- "smith-jones".

I would like to automatically capitalize the first letter and the
letter after the hyphen.

I can do the former using ASAP Utilities (a great plug-in!) but
haven't a clue as to how I capitalize the first letter after the
hyphen.

Any ideas on what to do?


Thanks,
SB


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Setting up capitalization after hyphens

Thanks very much. That did the trick!!

SB



On Mar 3, 2:19 pm, Gord Dibben <gorddibbATshawDOTca wrote:
smith-jones in A1

=PROPER(A1) in B1 returns Smith-Jones

Is that what you want?

A macro would do the job without the formulas.

Sub Proper_Case()
Dim rng As Range
Set rng = Nothing
On Error Resume Next
Set rng = Selection.SpecialCells(xlCellTypeConstants)
On Error GoTo 0
If rng Is Nothing Then
Else
rng.Formula = Application.Proper(rng.Formula)
End If
End Sub

Gord Dibben MS Excel MVP

On Mon, 3 Mar 2008 14:01:06 -0800 (PST), wrote:
Hi all:


I have a spreadsheet which lists 20,000 last names - all in lower
case. Some of these last names are hyphenated -- "smith-jones".


I would like to automatically capitalize the first letter and the
letter after the hyphen.


I can do the former using ASAP Utilities (a great plug-in!) but
haven't a clue as to how I capitalize the first letter after the
hyphen.


Any ideas on what to do?


Thanks,
SB


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
Removing text between hyphens and removing the hyphens sonofroy Excel Discussion (Misc queries) 8 January 20th 10 05:25 PM
Capitalization AMezera Excel Discussion (Misc queries) 7 June 24th 09 11:25 PM
Capitalization Patty Excel Discussion (Misc queries) 2 February 20th 06 07:29 PM
Capitalization? everlong Excel Worksheet Functions 2 February 2nd 06 01:45 AM
Does XL2K have "hard hyphens" (non-break hyphens)? StargateFan Excel Discussion (Misc queries) 0 January 29th 05 01:36 PM


All times are GMT +1. The time now is 01:48 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"