Change text to lower case

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Change text to lower case

Post by adam »

Hi Anyone,

I have text in the range mentioned in the following code which I want to change to lower case. I need help to modify this code so that I could do the needful. I tried by my self. But couldnt get the code get working

Code: Select all

Sub Lowercase()
   For Each x In Range("B1:B5")
      x.Value = LCase(x.Value)
   Next
End Sub
Any help would be kindly appreciated.

Thanks in advance.
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 78631
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change text to lower case

Post by HansV »

This macro should be in a standard module, not in a worksheet module. It should then work correctly, but keep in mind that this code will replace formulas in the range B1:B5 with their result.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Change text to lower case

Post by Rudi »

Just to add...

This too can be done without code:
In C1, type : =Lower(B1), and autofill to C5. :smile:
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Change text to lower case

Post by adam »

Thanks Rudi & Hans for you help & recommendation. I have solved the problem now. And I do really appreciate your help.
Best Regards,
Adam