Thread: Capital Letters
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
david mcritchie david mcritchie is offline
external usenet poster
 
Posts: 691
Default Capital Letters

Hi Nate,
WOW. A lot of testing. The main point was that a subroutine run
only once is going to take zero time during recalculations, and I
expect that the user would really prefer to change the data once
and be done with it.

I did not test your function for time or reliability. Yes it is easy to
incorporate the user function into a SUB which you did afterward.
What Excel actually does under the hood is going to run circles
around you using VBA because you are not even close to machine
instructions. In fact there are probably machine instructions for
AND-ind and OR-ing longs stings of bits or at least to separate
lowercase from uppercase letters..

I just tested your function, and it failed (#VALUE!) on the very first cell which
was empty. I know the poster said he started with all caps,
and your encompassing SUB would eliminate that possibility.
..
I would first convert to lowercase with a separate macro myself
and use a few macros as builting blocks. The second macro
would be Tushar's macro. Then looking over results.

I prefer running two macros to having options in macros or lots
of macros that are almost the same. [If the macro is only going
to be run once it isn't going to matter much whether you spend
time looking for one macro that does everything, or use
a couple of macros that will do the trick]

Normally if there is a problem with sentence case someone typed
in something and may have capitalized some names like IBM or
their own name mine is McRitchie. Running Tushar's sentence_case
would not destroy those words, nor will it force any Capital letter
to lower case.

I'm not saying that one macro is going to fit everyone's needs,
but was just offering an alternative that I know works for me, and
I was surprised how well regular expressions worked when I saw
Tushar's solution. I immediately changed reference to Harald Staff's
solution that I thought worked fine until then.

I just took a look at your SUB and noticed it had a hard coded
range, which is certainly not kind of thing that I would do in a
general purpose macro. Was actually looking to see if someone
selected only one cell if it would mess up the entire sheet.
See my proper.htm page for selection. Don't remember if
the poster posted a specific range, but I doubt that they would
really want such an absolute restriction.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Nate Oliver" wrote ...
With all due respect, I did test the function you mentioned before posting
to this thread, and unless I'm missing something, it doesn't appear to work
on the OP's string, i.e.,

te Oliver