Lcase

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
667
Office Version
  1. 365
Platform
  1. Windows
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

''''''''''''''''''''''''''''''''''''''''''''

'Forces text to UPPER case for a range XYX
'Forces text to Proper case for a range TUV

''''''''''''''''''''''''''''''''''''''''''''

If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub



    On Error Resume Next

    If Not Intersect(Target, Range("a1:a100")) Is Nothing Then

        Application.EnableEvents = False

        Target = UCase(Target)

        Application.EnableEvents = True

    End If
      

    On Error GoTo 0


If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub



    On Error Resume Next

    If Not Intersect(Target, Range("B1:B100")) Is Nothing Then

        Application.EnableEvents = False

        Target = StrConv(Target, vbProperCase)

        Application.EnableEvents = True

    End If

    On Error GoTo 0

    

End Sub

I need to include 'lcase'(lowercase) into the range E2:F100.

Having thought all I needed to do was alter ; Target = StrConv(Target, vbProperCase)' to Target = StrConv(Target, lcase) would of worked, but it does not.

Searching the web , never gave me the exact solution , so therefore I am reaching out to Mr Excel for help.

many thanks in advance & thank you for your help.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
How about
VBA Code:
Target = lCase(Target)
 
Upvote 0
Given that proper case is vbProperCase I would expect lower case to be vbLowerCase and upper case to be vbUpperCase

edit:- it actually tells you this if you use the vba help.
 
Upvote 0
Given that proper case is vbProperCase I would expect lower case to be vbLowerCase and upper case to be vbUpperCase

edit:- it actually tells you this if you use the vba help.
thanks Jason,
I used fluffs sugg & it works.. But I much appreciate your help.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
NP... its the least a can do . You / guys have saved me a whole lotta work.

have a great rest of your day :cool:
 
Upvote 0
For future reference, if you position your cursor in a command / keyword in the vba code editor then press F1 it should take you to a help page for that command.

The help shown might not always be helpful but it is a good place to start.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,726
Messages
6,126,498
Members
449,316
Latest member
sravya

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