

Also please visit my website www.software-solutions-online. If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me.
SPACED UNDERLINE IN EXCEL CODE

The If statement below checks if the user selected “None” from the drop down list: I am having an issues underlining text in a formula and have run out of ideas. The event handler loops through the columns and makes the necessary changes: Range(Cells(2, i), Cells(2, i)).Font.Underline _ĮlseIf Cells(1, i) = "Single Accounting" ThenĮlseIf Cells(1, i) = "Double Accounting" Then Private Sub worksheet_change( ByVal target As Range) 'executes when the user selects a new value from the drop down lists The event handler executes when the user selects a new value from the drop down lists: The program uses a Worksheet_Change event handler. The data for the drop down lists are stored in sheet 2: For more information about creating drop down lists in excel please see Excel VBA Drop Down Lists. The drop down lists are created using data validation.
SPACED UNDERLINE IN EXCEL UPDATE
In the figure below the user is selecting an underline style for cell C2 from the drop down list in cell C1:Īfter making the selection the underline style is update in the cell below: When the user makes a selection the underline style will change in row 2: The user selects an underline style from the drop down lists in row 1. You can download the file and code related to this article here. There are 4 different underline style the user can select from:įor more information about the different underline types and their associate VBA code please see Excel VBA, Underline Font Style. In this article I’ve provided an example on how you could use VBA to set underlines for cells and ranges.
