Hello All,
I am once again struggling with looping through all worksheets, when the code to run is beyond very basic. I have the code below that works great on whatever is the active worksheet to change anything in Column A to Proper Case
Sub ProperCase()
Dim rng As Range
For Each rng In Range("A2", [a65536].End(xlUp)) 'Start the VBA loop
rng = StrConv(rng.Text, vbProperCase)
Next
End Sub
What I need it to do is Loop through All Worksheets and run this code. I tried this:
Sub ProperCaseworksAlone()
Dim rng As Range
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws
For Each rng In Range("A2", [a65536].End(xlUp)) 'Start the VBA loop
rng = StrConv(rng.Text, vbProperCase)
Next
Next
End Sub
I do not know why it does not work other than thee are two "For Each" Statements? I do not necessarily need Last Row or Used Range. All of Column A can be changed to Proper Case. If the cells are blank, it does no harm.
I would appreciate any and all advice on what I am doing wrong and how to correct it.
Thanks so much,
Kathy