Applying case formatting in Excel

A question from Askville:

Excel question – is there any way to apply a function in place?

A couple of examples – I have a cell that is in lower case and I want it to be upper case. Can I apply that function to the cell? or do I have to create another column, apply the function there, copy and paste special:values to get the cell in the format I want? Or taking a cell with a name in it that isn’t “proper” – can I do that against the existing cell without having to go through all those other convulsions?

You can, but you’ll need to write a macro to do it. Something along these lines:

Sub ApplyUpper()
  For Each Cell In Selection
    Cell.Value = UCase(Cell.Value)
  Next Cell
End Sub

Sub ApplyProper()
  For Each Cell In Selection
    Cell.Value = StrConv(Cell.Value, vbProperCase)
  Next Cell
End Sub
This entry was posted in Answers, Technology. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *