View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Minitman Minitman is offline
external usenet poster
 
Posts: 293
Default Sentence Capitalization - Revisited

Hey Skinman,

Thanks for the reply.

My confusion over why the sentence caps were working except for the
first sentence has been enlightened. I had accidentally turned on
AutoCorrectCapitalize first letter of sentences. Strangely enough,
since it did not see any spaces in front of the first letter, it just
ignored it.

I was able to get jindons vbscript code to do the first letter (it was
supposed to do all of the sentences not just the first). With the
AutoCorrect active and jindon's code in the Worksheet_Change event,
the named ranges is capitalizing the way it should, with some minor
glitches.

Your idea of using a helper column does have some merit, just not in
this case.

Again, thanks for the effort.

-Minitman


On Thu, 10 Jul 2008 15:02:09 +1000, "Skinman"
wrote:

This macro will capitalize the first word. Just click on the merged cell
that you want to capitalize and run the macro. If your data uses more than
50 columns
you will need to change all the 50's to a higher number. If this is not what
you want, the formula for making the first word a capital is :-
"=UPPER(LEFT(RC[50]))&RIGHT(LOWER(RC[50]),LEN(RC[50])-1)" Hope this
helps.


Sub FirstLetterCapital()
Application.ScreenUpdating = False
ActiveCell.Range("A1:D1").Select
Selection.Copy
ActiveCell.Offset(0, 50).Range("A1:D1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -50).Range("A1:D1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=UPPER(LEFT(RC[50]))&RIGHT(LOWER(RC[50]),LEN(RC[50])-1)"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 50).Range("A1:D1").Select
Application.CutCopyMode = False
Selection.ClearContents
ActiveCell.Offset(0, -50).Range("A1:D1").Select
Application.ScreenUpdating = True
End Sub


"JLGWhiz" wrote in message
...
Post the code you are trying.

"Minitman" wrote:

Greetings,

I thought this was completed, boy was I wrong!

The problem is solved for the UserForm TextBoxes. However, I can't
seem to get that code to work for worksheet merged cell named ranges.

I am not even sure where to put the code.

So the question is, how do I get these four merged cell named ranges
to format with the first letter of each sentence being capitalized?

Any help will be appreciated.

-Minitman