Convert uppercase to lowercase

M

Mervyn Thomas

Does anyone have a bit of code to convert a file of conatcts all in
UPPERCASE to Lower Case?
 
J

JLGWhiz

Sub dk()
Dim nm As Range
For Each nm In Range("A2:A25") 'substitute actual range
nm = StrConv(nm.Value, vbProperCase)
Next

End Sub
 
R

Ryan H

Use the LCase Function.

LCase("Your String Here")

Hope this helps! IF so, let me know, click "YES" below.
 
G

Gord Dibben

"Lower Case" looks like Proper Case to me.

You choose.................

Sub Lower()
Dim Cell As Range
Application.ScreenUpdating = False
For Each Cell In Selection
Cell.Formula = LCase(Cell.Formula)
Next
Application.ScreenUpdating = True
End Sub


Sub Proper()
Dim Cell As Range
Application.ScreenUpdating = False
For Each Cell In Selection
Cell.Formula = Application.Proper(Cell.Formula)
Next
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP
 
M

Mike

Sub lowerCase()
Dim r As Long
r = 1
Do While Len(Range("A" & r).Formula) > 0
' repeat until first empty cell in column A
With Range("A" & r)
.Value = LCase(.Value)
End With
r = r + 1 ' next row
Loop
End Sub
 
R

Ryan H

I'm not sure where your range of data you want to change to Lower Case so I
assume it is in Sheet1 in Col. A. Here is some code you can run which will
change all data in Column to lower case. Hope this helps! If so, let me
know, click "YES" below.

Sub ConvertToLowerCase()

Dim rng As Range

With Sheets("Sheet1")
For Each rng In .Range("A1:A" & .Cells(Rows.Count, "A").End(xlUp).Row)
rng.Value = LCase(rng.Value)
Next rng
End With

End Sub
 
M

Mervyn Thomas

PS with all these methods how do you find in the VB help the various
options in your StrConv(nm.Value, vbProperCase) ? Or is their a decent
manual somwehere? I would much prefer being able to find it myself rather
than bother you guys!
Thanks again!
Mervyn
 
R

Ryan H

In the VBE, you can put your cursor in the word/method you are interested in
learning about and press F1, this will take you directly to the help section
it is in.

I just read some books, check this forum out a lot and you come across a lot
of functions that other people use, then learn about it. It takes time but
you can catch on quickly.
 
J

JLGWhiz

Some of them are difficult to find if you start from scratch. You can find
the options for StrConv by opening VBE Alt + F11 and typing that term in the
VBA help search box. Then select it from the topic listing when it shows.
Or you can do it like Ryan suggests and select it with the mouse, then press
F1 key.

I spent many hours searching the help files when I first began to write
code. I was not aware that the news group existed back then, but it was a
good learning process, because I found many things that I later used, plus
it gave me a broader view of what VBA could do. I am still learning and
find that I have only scratched the surface of VBA capabilities, although I
have written some pretty complex code before. The main thing is to have a
good understanding of the conventions used by the designers of VBA. If you
can get into their heads a little bit, it will help you to find methods and
tools in the VBA help files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top