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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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,217,055
Messages
6,134,330
Members
449,866
Latest member
veeraiyah

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