Convert lc to UC in rows of spreadsheet

  • Thread starter Thread starter Cammie
  • Start date Start date
C

Cammie

I've inadvertently entered a bunch of data in mixed lc/UC
and it needs to be converted to all UC on multiple lines
of a spreadsheet -- is there an easier fix than rekeying???
 
Sub TextConvert() 'Better than mine
'By Ivan F Moala
Dim ocell As Range
Dim Ans As String

Ans = Application.InputBox("Type in Letter" & vbCr & _
"(L)owercase, (U)ppercase, (S)entence, (T)itles ")

If Ans = "" Then Exit Sub

For Each ocell In Selection '.SpecialCells(xlCellTypeConstants, 2)
Select Case UCase(Ans)
Case "L": ocell = LCase(ocell.Text)
Case "U": ocell = UCase(ocell.Text)
Case "S": ocell = UCase(Left(ocell.Text, 1)) & _
LCase(Right(ocell.Text, Len(ocell.Text) - 1))
Case "T": ocell = Application.WorksheetFunction.Proper(ocell.Text)
End Select
Next

End Sub
 
you can use =UPPER(A1) to convert text to upper case in C1. If you have a
bunch of cells to do this with, go to a new,blank worksheet and type
=UPPER(Sheet1!A1) (this assumes the sheet you want capitalized is Sheet1)
then copy that formula over and down as far as you want. Then copy and paste
the contents of the sheet special as text.
 
Column a is lower case in column b =upper(a1) or vise
versa =lower(a1)

Hope it works.
Lou
 
Also Cammie ensure when you use the formula you copy the
cells and paste values into the formula cell after
conversions done.

Lou
 
There's a worksheet text function called UPPER (and one for LOWER). Simply put =UPPER(cell reference) and it will turn the whole cell into uppercase.
 
Back
Top