VBA & Macro Problems

How to Use the Correct VBA Function to Convert Text to Lowercase in Excel

Camila MilosovichCamila Milosovich Nov 10, 2026 870 views

Question details

The user needs to convert text to lowercase using an Excel VBA macro but encounters an error when attempting to use the standard Excel LOWER function.

How to Convert Text to Lowercase in Excel VBA
Product
Excel
Device & OS
not provided
Scenario
Writing or executing a VBA macro that involves modifying the case of a text string to entirely lowercase.
Observed behavior
Calling Lower or WorksheetFunction.Lower directly within the VBA code produces a runtime error because the function is not supported as a method of WorksheetFunction.
Before you start

Ensure that the Developer tab is enabled in your spreadsheet program and make a quick backup of your existing macro code before applying modifications.

Solution 1Recommended

Use the Built-in LCase Function in VBA

Replace the unsupported WorksheetFunction.Lower method with VBA's native LCase function to successfully convert text to lowercase.

Because VBA provides a native equivalent to Excel's LOWER function, the LOWER method is intentionally excluded from the WorksheetFunction object. Attempting to call it will trigger a runtime error.

The native VBA function LCase is highly efficient, works directly with string variables, and requires no special object references.

1
Open the VBA Editor

Launch your Excel workbook and press ALT + F11 to open the Visual Basic for Applications (VBA) editor.

2
Locate the target macro

In the Project Explorer panel, double-click the Module containing the macro where you want to perform the lowercase conversion.

3
Apply the LCase function

Find the line causing the error and replace WorksheetFunction.Lower(myInput) with the native syntax: myTest = LCase(myInput).

4
Test the macro execution

Save the changes and run the macro to verify that the text string is properly converted to lowercase without generating errors.

Use the Built-in LCase Function in VBA
Converting to Uppercase: If you need to convert a text string to uppercase instead of lowercase, simply use VBA's UCase function, formatted as UCase(myInput).
Advanced Macro Support

Write and Run VBA Macros Seamlessly in WPS Spreadsheet

WPS Office provides excellent built-in support for VBA macros in its Spreadsheet application. You can write, execute, and debug code just like you would in Microsoft Excel, including native functions like LCase and UCase.

  1. 1. Launch WPS Spreadsheet: Open WPS Office and create a new or open an existing Spreadsheet document.
  2. 2. Access the Developer Tools: Navigate to the Developer tab on the top ribbon menu.
  3. 3. Open the VBA Editor: Click on the Visual Basic icon or use the ALT + F11 shortcut to launch the macro programming environment.
  4. 4. Write your LCase code: Insert a new module and apply the LCase function directly to your string variables, then save your file as a macro-enabled workbook to preserve the code.
Fully compatible with Microsoft Excel macro formats (.xlsm, .xlsb)Built-in robust VBA Editor for creating custom automated workflowsSupports native VBA string conversion functions efficientlyLightweight installation with a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does WorksheetFunction.Lower cause an error in VBA?

VBA intentionally excludes LOWER from the WorksheetFunction object because it already contains a built-in equivalent called LCase. When VBA encounters WorksheetFunction.Lower, it throws a runtime error because the method is simply not defined in that library.

How do I change text to proper case (title case) in VBA?

Unlike lowercase and uppercase, VBA does not have a native Proper function. To convert text to proper case, you must either use the StrConv function formatting like StrConv(text, vbProperCase), or call the worksheet function via Application.WorksheetFunction.Proper(text).

Does the LCase function affect numbers and symbols within a string?

No, the LCase function strictly targets alphabetical characters. Any numbers, punctuation marks, or special symbols contained within the string variable will be ignored and remain completely unchanged.