View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Proper case code not working right

Juan,

Try

Sub ConvertToProperCase()
Dim Rng As Range
For Each Rng In Range("C1:C" & Cells(Rows.Count,"C").End(xlUp).Row)
If Rng.HasFormula = False Then
Rng.Value = StrConv(Rng.Value, vbProperCase)
End If
Next Rng
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Juan" wrote in message
...
Hello,
In column C I have some words in All caps and some have
Lower case. I got the following code:
Sub ConvertToProperCase()
Dim Rng As Range
For Each Rng In Selection.Cells
If Rng.HasFormula = False Then
Rng.Value = StrConv(Rng.Value, vbProperCase)
End If
Next Rng
End Sub

Before I run this, I select Column C, then I run the
macro, it seems to work but it doesn't stop and goes on an
on and I need to End the program because it takes forever.
So not sure if I have to revised the code. As I mention, i
need to do this is Column C.
Please advise any help.
Thank you,
JUAN