close

I am just learning the wonders of macros but wouldn't have a clue how to
write the code! If possible can somebody please write me a code to change
text from uppercase to proper case. I would really appreciate it. Thanks


Range(quot;A1quot;).Value = UCase(Range(quot;A1quot;).Value)

or

myVar = UCase(Range(quot;A1quot;).Value)

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

quot;Taniaquot; gt; wrote in message
...
gt; I am just learning the wonders of macros but wouldn't have a clue how to
gt; write the code! If possible can somebody please write me a code to change
gt; text from uppercase to proper case. I would really appreciate it. Thanks
This is relatively straightforward as there is a worksheet function available
=PROPER(text) so coding this in VBA just needs a slight modification:-

newText = Application.WorksheetFunction.Proper(ActiveCell.Te xt)
ActiveCell.Offset(0, 1) = newtext

quot;Taniaquot; wrote:

gt; I am just learning the wonders of macros but wouldn't have a clue how to
gt; write the code! If possible can somebody please write me a code to change
gt; text from uppercase to proper case. I would really appreciate it. Thanks

Hi Tania,
See macros in
www.mvps.org/dmcritchie/excel/proper.htm
certainly tells you how to write macro code as well as providing the
complete macros.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: www.mvps.org/dmcritchie/excel/excel.htm
Search Page: www.mvps.org/dmcritchie/excel/search.htm

quot;Taniaquot; gt; wrote in message ...
gt; I am just learning the wonders of macros but wouldn't have a clue how to
gt; write the code! If possible can somebody please write me a code to change
gt; text from uppercase to proper case. I would really appreciate it. Thanks
Thank you all for your replies. Unfortunatley I am still having problems. I
pasted the codes (seperately) into the 'create macro' section, selected the
whole of my spreadsheet (as it is a mail merge doc all in uppercase) and
tried to run it but nothing happened. I am doing something really wrong?
Sorry but i really know nothing about macros. Please help! Thanks

quot;bigwheelquot; wrote:

gt; This is relatively straightforward as there is a worksheet function available
gt; =PROPER(text) so coding this in VBA just needs a slight modification:-
gt;
gt; newText = Application.WorksheetFunction.Proper(ActiveCell.Te xt)
gt; ActiveCell.Offset(0, 1) = newtext
gt;
gt; quot;Taniaquot; wrote:
gt;
gt; gt; I am just learning the wonders of macros but wouldn't have a clue how to
gt; gt; write the code! If possible can somebody please write me a code to change
gt; gt; text from uppercase to proper case. I would really appreciate it. Thanks

Hi Tania,
The code that BigWheel provided for a macro would convert only one cell,
which is more suitable for a Change Event macro and in any case is incomplete
as you need a SUB and End Sub statements which would be recognized by
someone more familiar with macros.. .
Suggest you look at my
www.mvps.org/dmcritchie/excel/preoper.htm

Even if you attempt to fix upon entry (Change event) you would still
need to change your existing entries. I normally would not bother
with the change event as I would normally change existing entries and
not input them incorrectly later.

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

quot;Taniaquot; gt; wrote in message ...
gt; Thank you all for your replies. Unfortunatley I am still having problems. I
gt; pasted the codes (seperately) into the 'create macro' section, selected the
gt; whole of my spreadsheet (as it is a mail merge doc all in uppercase) and
gt; tried to run it but nothing happened. I am doing something really wrong?
gt; Sorry but i really know nothing about macros. Please help! Thanks
gt;
gt; quot;bigwheelquot; wrote:
gt;
gt; gt; This is relatively straightforward as there is a worksheet function available
gt; gt; =PROPER(text) so coding this in VBA just needs a slight modification:-
gt; gt;
gt; gt; newText = Application.WorksheetFunction.Proper(ActiveCell.Te xt)
gt; gt; ActiveCell.Offset(0, 1) = newtext
gt; gt;
gt; gt; quot;Taniaquot; wrote:
gt; gt;
gt; gt; gt; I am just learning the wonders of macros but wouldn't have a clue how to
gt; gt; gt; write the code! If possible can somebody please write me a code to change
gt; gt; gt; text from uppercase to proper case. I would really appreciate it. Thanks

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()