[mso] Re: Excel VBA Code
- From: "Herbert Chitate" <herbertc@xxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Wed, 14 Jan 2009 11:06:37 -0000
Hi Hutch,
Many thanks for the code below, it set me on the right direction as I am still
a bit of a newbie in this game. I had to tweak it a bit, as it was kicking out
a syntax error, and the final code I used was:
Public Sub ConvertToProper()
Dim c As Range, Rng As Range
Set Rng = Selection
For Each c In Selection
c.Value = WorksheetFunction.Proper(c.Value)
Next c
End Sub
Herbert
-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf Of
Thomas Hutchins
Sent: 13 January 2009 18:17
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Excel VBA Code
Try...
Public Sub ConvertToProper()
Dim c As Range
For Each c In Selection
c.Value = WorksheetFunction.Proper(c.Value)
Next c
End Sub
Place this code in a VBA module in your workbook.
Hope this helps,
Hutch
--- On Tue, 1/13/09, Herbert Chitate <herbertc@xxxxxxxxx> wrote:
From: Herbert Chitate <herbertc@xxxxxxxxx>
Subject: [mso] Excel VBA Code
To: mso@xxxxxxxxxxxxx
Date: Tuesday, January 13, 2009, 10:10 AM
Hi All,
I am trying to come up with a code which when I highlight certain text
(selection), and run the code it applies the formula
"=proper(selection)" to the selected text, replacing the text with
appropriate lower and upper text cases.
Can anybody help?
Many thanks
Herbert
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the
dropdown menu at the top. This will allow you to unsubscribe your email address
or change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join and
share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join
and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join
and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
Other related posts: