Excel 2000: VB code for changing caseof text

  • Thread starter Thread starter pgnl
  • Start date Start date
P

pgnl

I am hoping some kind person can help me with this Excel 2000 problem......

I need a short piece of VB code I can attach to a Button in the tool bar,
such that when I select a cell containing text it converts it from capitals
to small case or even better, capitalise just the first character of the
sentence (or alternatively work like the 'proper' function capitalise the
first letter of each word...)

I can do this easily in Word by pressing shift-F3, but there does not appear
to be a similar function in Excel 2000.

Thanks for your help.


Patrick
Worcestershire, UK
 
ActiveCell.Value = strConv(ActiveCell.Value, vbProperCase)

or use vbLowerCase or vbUpperCase

or for the first character

Dim sStr as String
sStr = strConv(ActiveCell.Value,vbLowerCase)
sStr = ucase(left(sStr,1) & Mid(sStr,2)
 
Many thanks for your replies, I have now found some code and adapted it to
do what I want...

Patrick
Worcs, UK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top