ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Chnaging Case (https://www.excelbanter.com/excel-programming/325587-chnaging-case.html)

Teresa

Chnaging Case
 
Hi,

In cells c1 to h200 I have long sentences in each cell,
all the letters are in capitals. I need to write a macro
which loops through each cell and changes the letters to small
except:
1)The first letter
2) Any letter after a full stop
3) i

e.g. THE DAY WAS SUNNY AND I WORE A HAT.PETER WAS THERE

Becomes

The day was sunny and I wore a hat.Peter was there

Thanks A Million for any help





NickHK

Chnaging Case
 
teresa,
In VBA, check out:
LCase -change the whole sentence to lower case
Split -break up you sentence on the "."
Replace -change i to I
UCase(Left -change the first letter of each sentence to Upper case.
And make your own function.

If you intend to handle proper nouns (Peter) correctly, you've got a lot
more work.

NickHK

"teresa" wrote in message
...
Hi,

In cells c1 to h200 I have long sentences in each cell,
all the letters are in capitals. I need to write a macro
which loops through each cell and changes the letters to small
except:
1)The first letter
2) Any letter after a full stop
3) i

e.g. THE DAY WAS SUNNY AND I WORE A HAT.PETER WAS THERE

Becomes

The day was sunny and I wore a hat.Peter was there

Thanks A Million for any help







Nate Oliver[_3_]

Chnaging Case
 
Hi Teresa,

I responded in your other thread:

http://groups-beta.google.com/group/...6dc0b1afa3003e

Google snafued the wrapping in my second post (big time!), hopefully you're
not using that interface!

As Nick mentioned, I made no attempt to deal with proper nouns, acronyms or
anything of the sort.

Regards,
Nate Oliver

Dave Peterson[_5_]

Chnaging Case
 
You have another reply at your other post.

teresa wrote:

Hi,

In cells c1 to h200 I have long sentences in each cell,
all the letters are in capitals. I need to write a macro
which loops through each cell and changes the letters to small
except:
1)The first letter
2) Any letter after a full stop
3) i

e.g. THE DAY WAS SUNNY AND I WORE A HAT.PETER WAS THERE

Becomes

The day was sunny and I wore a hat.Peter was there

Thanks A Million for any help




--

Dave Peterson

NickHK

Chnaging Case
 
teresa,
As another thought, you could see how much mileage you can get from Excel's
grammar/spell checker.

NickHK

"teresa" wrote in message
...
Hi,

In cells c1 to h200 I have long sentences in each cell,
all the letters are in capitals. I need to write a macro
which loops through each cell and changes the letters to small
except:
1)The first letter
2) Any letter after a full stop
3) i

e.g. THE DAY WAS SUNNY AND I WORE A HAT.PETER WAS THERE

Becomes

The day was sunny and I wore a hat.Peter was there

Thanks A Million for any help








All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com