change every other column to proper case

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
784
Office Version
  1. 365
Platform
  1. Windows
Hi

I use this macro in a spreedsheet to change what is typed in C:C to proper case
I got a lot of help for writing the macro from this site…Thank you
I would like to modify it for another worksheet.
I would like to have every other column change to proper case
B4:B40,D4:D40,F4:F40 all the way to X4:X40
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 Then
Application.EnableEvents = False
Target.Value = WorksheetFunction.Substitute(WorksheetFunction.Proper(WorksheetFunction.Substitute(Target, "'", "z-z")), "z-Z", "'")
Application.EnableEvents = True
End If
End Sub
The columns in between are numbers

mike
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Try:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("B:X")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    If Target.Column Mod 2 = 0 Then
        Target = Application.WorksheetFunction.Proper(Target)
    End If
    Application.EnableEvents = True
End Sub[CODE=vba]
[/CODE]
 
Upvote 0
Solution

Forum statistics

Threads
1,215,063
Messages
6,122,930
Members
449,094
Latest member
teemeren

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