PDA

View Full Version : Solved: ALL UPPER CASE FONTS



GaryB
12-29-2006, 12:11 PM
Hi,

A couple of days ago I posted a need to take an worksheet and make all the fonts all upper and lower case. Now I have a need to convert them back to all upper case.

The code was

Dim c As Range For Each c In ActiveSheet.Range(Cells(1, 1), Cells(1, 1).SpecialCells(xlLastCell)).Cells If Left(c.Formula, 1) <> "=" Then c.Value = Application.WorksheetFunction.Proper(c.Value)
Next c

Any Help with changing this to convert to all uppercase would be appreciated.

Happy New Year to All

Gary

Brandtrock
12-29-2006, 01:03 PM
Change Proper to UPPER

GaryB
12-29-2006, 01:12 PM
Thanks,

I'll give it a shot and post back

Gary

Bob Phillips
12-29-2006, 01:41 PM
Don't do that, VBA has its own upper case method



Dim c As Range
For Each c In ActiveSheet.Range(Cells(1, 1), Cells(1, 1).SpecialCells(xlLastCell)).Cells
If Not c.HasFormula Then c.Value = UCase(c.Value)
Next c

GaryB
12-29-2006, 01:50 PM
That explains the error message when I changed it to Upper. Thanks XLD that did the trick.

Have a safe New Years Eve.

Gary

Brandtrock
12-29-2006, 03:22 PM
Sorry Gary.

Thanks KLD, I always mess that up.

Regards,

GaryB
12-29-2006, 03:27 PM
Not a problem,

Thanks for the help.

Gary