Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tania
 
Posts: n/a
Default Macro for proper case

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Macro for proper case


Range("A1").Value = UCase(Range("A1").Value)

or

myVar = UCase(Range("A1").Value)

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Tania" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
bigwheel
 
Posts: n/a
Default Macro for proper case

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

"Tania" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
David McRitchie
 
Posts: n/a
Default Macro for proper case

Hi Tania,
See macros in
http://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: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Tania" wrote in message ...
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



  #5   Report Post  
Posted to microsoft.public.excel.misc
Tania
 
Posts: n/a
Default Macro for proper case

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

"bigwheel" wrote:

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

"Tania" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.misc
David McRitchie
 
Posts: n/a
Default Macro for proper case

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
http://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: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Tania" wrote in message ...
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

"bigwheel" wrote:

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

"Tania" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count colored cells? DKY Excel Worksheet Functions 21 January 19th 06 09:47 PM
color coding Ardilla Excel Worksheet Functions 1 January 11th 06 08:49 PM
VBA Code Cell Mate Excel Discussion (Misc queries) 4 January 9th 06 08:52 PM
Convert number into words Blackwar Excel Discussion (Misc queries) 4 December 2nd 05 12:05 PM
reminder notifications in a column L Mieth Excel Discussion (Misc queries) 6 June 10th 05 11:00 AM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"