Removing all lowercase/non-capitalized words in a sheet

mlarson

Well-known Member
Joined
Aug 25, 2011
Messages
509
Office Version
  1. 2010
Platform
  1. Windows
Hi all! I'm hoping you can help me.

I would like all lowercase/non-capitalized words to be removed from my active sheet (rows 2 to 500), with only capitalized words remaining. Is there a macro/VBA or formula to accomplish this task?

For example: Is Vienna a city in Austria? (in cell B7)
Desired output/result: Is Vienna Austria (in cell B7, the same cell)

Another example: where do John and I go to school? (in cell C5)
Desired output/result: John I (in cell C5)

I hope I am explaining this clearly. Thanks in advance for your help!
 
Hi Micron, I don't mind it keeping numbers.

I've been using the code that Herakles provided and it was working really well for about an hour... running it every 5-10 minutes or so. But now it seems like it is running an endless loop the last few times I've tried.

Anybody have thoughts on why that might be? Cleared some memory from my computer but that didn't seem to help.

Thanks.
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
It just gave me this debug/error...
If Len(rngCell) > 0 Then

Run-time error '13':
Type mismatch

It wasn't giving that before, it would just run forever. Thoughts?
 
Last edited:
Upvote 0
My guess based on that is if rngCell is null/empty it becomes Nothing thus you cannot use functions such as Left, Len etc. on it. The root of the problem might be due to using UsedRange as it includes cells with formatting and such even if they have no data.
 
Upvote 0

Forum statistics

Threads
1,215,843
Messages
6,127,240
Members
449,372
Latest member
charlottedv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top