View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
david mcritchie david mcritchie is offline
external usenet poster
 
Posts: 691
Default Changing from lower to upper case

The macro Ron first supplied was a generic solution working from
a selection that the user makes before running the macro.
The subsequent example used a specific range B1:B10

If you have a named range in your workbook, you can
use it and it goes within the double quotes in the same
manner.
.Range("B1:B10")
.RANGE("B:B")
.RANGE("ZipStateRange").

The use of SpecialCells automatically limits the range
to the usedrange. Reducing that selection to Text cells
eliminates processing blank cells and formulas.

Another method would be to use an Event macro, which would
only apply to the one worksheet and would be automatic, which is
what Gord supplied.

FWIW, examples on my pages
http://www.mvps.org/dmcritchie/excel/proper.htm#upper
http://www.mvps.org/dmcritchie/excel....htm#uppercase
Even if you use an Event macro you might want to also install
the regular macro to fix up existing entries. Hopefully this is
only for things like zip state codes that should be capitalized,
rather than people's names.

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm


"Matt" wrote ...
Is there a way I can name the range in your example? That
way the user doesn't have to select the range and run the
macro. Thanks. Matt