A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Change case in database fields from CAPS to Proper



 
 
Thread Tools Display Modes
  #1  
Old November 5th, 2003, 10:36 PM
Dave R.
external usenet poster
 
Posts: n/a
Default Change case in database fields from CAPS to Proper

Use the function called PROPER
ie PROPER(A1) turns BILL SMITH to Bill Smith

"Rob Coombs" wrote in message
news
We are trying to edit 1000 names in excel, all entered as CAPITALS, and we
would like to convert their name, address and city to Proper case and
haven't had any luck yet.
Any recommendations?

Thank you in advance for your time and assistance.



  #2  
Old November 5th, 2003, 10:44 PM
Ken Wright
external usenet poster
 
Posts: n/a
Default Change case in database fields from CAPS to Proper

Always back your data up first - A couple of routines to do as you asked.

----------------------------------------------------
Sub MakeProperCase()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Dim myCell As Range
Dim myRng As Range

On Error Resume Next
Set myRng = Intersect(Selection, _
Selection.Cells _
.SpecialCells(xlCellTypeConstants, xlTextValues))
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "Please select a range that contains text--no formulas!"
Exit Sub
End If

For Each myCell In myRng.Cells
myCell.Value = StrConv(myCell.Value, vbProperCase)
Next myCell
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub


-------------------------------------------------
Sub ProperCaseMak()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim c As Range
For Each c In ActiveSheet.UsedRange
If c.HasFormula = False Then
c.Value = StrConv(c.Value, vbProperCase)
End If
Next c
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL2K & XLXP

----------------------------------------------------------------------------
Attitude - A little thing that makes a BIG difference
----------------------------------------------------------------------------



"Rob Coombs" wrote in message
news
We are trying to edit 1000 names in excel, all entered as CAPITALS, and we
would like to convert their name, address and city to Proper case and haven't
had any luck yet.
Any recommendations?

Thank you in advance for your time and assistance.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.535 / Virus Database: 330 - Release Date: 01/11/2003


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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