Tuesday, July 22, 2008

How to Change All the Lowercase Letters in an Excel Worksheet to Uppercase Letters?

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Cells(1,1) = "abcdef" 'enter data in the cells
objWorksheet.Cells(1,2) = "ghijkl"
objWorksheet.Cells(1,3) = "mnopqr"
objWorksheet.Cells(1,4) = "stuvwx"
Wait (10)
Set objRange = objWorksheet.UsedRange
For Each objCell in objRange
objCell.Value = UCase(objCell.Value)
Next

Google Search

Google