«

»

Mar
19
2013

Uppercase/Lowercase conversion in Excel through VBA

Well, there is no easy way to ‘change case’ in excel. So i wrote few small VBA snippets to perform case conversion.

To perform uppercase conversion on the selected cells

Sub UpperCase()

Dim Cell As Object

For Each Cell In SelectionCell.Value = StrConv(Cell.Value, vbUpperCase)

Next

End Sub

To perform lowercase conversion on the selected cells

Sub LowerCase()

Dim Cell As Object

For Each Cell In SelectionCell.Value = StrConv(Cell.Value, vbLowerCase)

Next

End Sub

You can configure keyboard shortcuts for calling the functions above

If you are unsure about how to configure a keyboard short or a button then check out these posts:

How to assign a keyboard shortcut for an Excel VBA Macro

Assigning Excel 2007 Macros to Buttons / Trigger VBA Macros from Buttons

 

Did you find this post useful? Feel free to share your feedback in the comments area.

You can find more interesting posts from us on the posts index section

If you are interested to be notified for the new posts from us, then you can make use of the subscribe option available on the right sidebar.

Help us to improve our search rating by recommending this post to Google using the button below

 

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>