How to Automatically Capitalize Words in Excel Without a Formula
Question details
The user wants to automatically capitalize the first letter of every word entered into specific Excel cells without relying on formulas.

- Product
- Microsoft Excel
- Device & OS
- Windows and Mac
- Scenario
- Entering text data into a spreadsheet where consistent proper case formatting is required instantly upon typing.
- Observed behavior
- Excel does not have a built-in Word-style auto-capitalize feature, requiring the use of formulas or VBA macros to automate text capitalization.
Ensure you are using the desktop version of Excel for Windows or Mac, as VBA macros are not supported in Excel for the Web.
Use a VBA Worksheet_Change Event to Auto-Capitalize Text
Apply a simple VBA script to a specific worksheet to automatically convert typed text to proper case in a defined range.
This method utilizes the VBA StrConv function with the vbProperCase parameter. It triggers automatically whenever data is entered into the specified cells, changing the text formatting as soon as you press Enter.
Right-click the worksheet tab at the bottom of your Excel window and select 'View Code'. This will open the Microsoft Visual Basic for Applications (VBA) editor.
In the code window that appears, paste the following code to target cells B2:B20: Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range Dim cel As Range Set rng = Intersect(Range("B2:B20"), Target) If Not rng Is Nothing Then Application.ScreenUpdating = False Application.EnableEvents = False For Each cel In rng cel.Value = StrConv(cel.Value, vbProperCase) Next cel Application.EnableEvents = True Application.ScreenUpdating = True End If End Sub
Close the VBA editor and go to File > Save As. Change the file format to 'Excel Macro-Enabled Workbook (*.xlsm)' to ensure your code is saved and runs correctly.

Apply Auto-Capitalization Across All Worksheets
Place the VBA logic in the ThisWorkbook module if you want the auto-capitalization behavior to apply to every worksheet in your workbook.
Use WPS Spreadsheet to Run Macros and Automate Tasks
WPS Office fully supports VBA macros, allowing you to seamlessly run text formatting scripts like auto-capitalization without the need for manual formulas.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook or create a new one.
- 2. Access the VBA Editor: Navigate to the 'Tools' or 'Developer' tab on the ribbon and click on 'VB Editor'.
- 3. Insert the Macro Code: Double-click your desired sheet in the Project window and paste the auto-capitalize VBA code.
- 4. Save your Document: Save your file as an .xlsm Macro-Enabled Workbook to keep your automations active.

Frequently Asked Questions
Can I auto-capitalize text in Excel for Web?
No, Excel for the Web does not support VBA macros. To achieve auto-capitalization online, you must use the PROPER formula in an adjacent column or open the file in a desktop version of Excel.
Why isn't the VBA macro running when I type?
This usually happens if macros are disabled in your Trust Center settings, or if the file was not saved as an .xlsm workbook. Additionally, if a previous macro error halted execution, you may need to run 'Application.EnableEvents = True' in the Immediate Window to restore event triggers.
Is it possible to capitalize the first letter of only the first word?
Yes, but you will need to modify the VBA code. Instead of using 'vbProperCase', you would use a custom function or combination of 'UCase', 'Left', and 'Mid' string functions to capitalize just the first character of the cell.




