Capitalize cells in 3 different columns

akalien

New Member
Joined
Jul 2, 2010
Messages
21
Office Version
  1. 2019
Platform
  1. Windows
Hello everyone,


I have absolutely no knowledge of VBA and I’m looking for a code to capitalize, after input, all the cells, except column headers in row 1, of the following 3 columns: "G", "J" and "M".


Many thanks for your suggestions
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hello everyone,


I have absolutely no knowledge of VBA and I’m looking for a code to capitalize, after input, all the cells, except column headers in row 1, of the following 3 columns: "G", "J" and "M".


Many thanks for your suggestions
Put this code in the worksheet code module.

Right click on the worksheet tab and select view code.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If (Not Intersect(Target, Range("G:G,J:J,M:M")) Is Nothing) And Target.Row <> 1 Then
    
        Application.EnableEvents = False
        Target.Value = UCase(Target.Value)
        Application.EnableEvents = True
    
    End If

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,361
Messages
6,124,497
Members
449,166
Latest member
hokjock

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