Forum Discussion
Font size in a drop down list
Unfortunately, the font size of a drop-down list can only be changed using VBA.
However, you can make the font smaller around the drop-down box (or across the entire sheet), and then zoom in on the overall view. In this way, the font in the drop-down field is also displayed larger.
VBA code :
Alternatively, only with a little trick - simply enlarge the zoom to, for example, 200 when a cell is selected with a dropdown (otherwise set it back to 100):
Change event must be incorporated.
Private Sub Worksheet_Change (ByVal Target As Excel.Range)
On Error Resume Next
If Target.Validation.InCellDropdown Then ActiveWindow.Zoom = 100
End Sub
Private Sub Worksheet_SelectionChange (ByVal Target As Excel.Range)
On Error GoTo error handler
If Target.Validation.InCellDropdown Then ActiveWindow.Zoom = 200
Exit Sub
error handler:
ActiveWindow.Zoom = 100
End Sub
Hope I was able to help you.
Wish you continued success with Excel (the coolest invention since Chocola ... uh ... Microsoft! :-)))
And ... Please keep asking here - I've just taught myself Excel with the help of this forum ... almost 🙂
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here
Hi all; the original poster asked for a solution to changing the font size in a data-validated Excel drop-down list. All of the answers I've seen change the zoom of the entire sheet using ActiveWindow.Zoom = xxx, which is (in my case) not usable - although it might be fine for the original poster. Can anyone point to a solution for changing the *font size* in the list, or changing the zoom *of the cell*, not the entire worksheet ? VBA solutions would be fine... I have tried to apply this same method to change the cell itself when selected (or rather, when the data-validated drop-down is selected), and I've not been successful.
NikolinoDE- you said that " the font size of a drop-down list can only be changed using VBA". I'm happy to try that - can you elaborate on how to change the font size, not the worksheet zoom, please?
Appreciate any help or references. Thanks ! Mal.
- NikolinoDEJun 28, 2022Gold Contributor
It's still not clear to me what you want to do, since the translation isn't very helpful to me.
Do you want the cell text to adjust?
If so, then it would have to be clarified whether it should be with line breaks or simply adapt the text to the cell size (no matter how small the text could be).With "Format Cells..." you can just select the cell and fit the text to fit the cell size (without changing row and column) or set the text to wrap text if you want the cell width to stay the same.
Here are the steps:1. Highlight the cells you want to format.
2. Invoke the "Format Cells..." command. You can do this in all Excel versions using the key combination CTRL + 1.
3. In the dialog box that appears, activate the "Alignment" tab.
4. Click the "Fit to cell size" option.
With this option you optimize the font size for the cell width
5. Confirm your definition with the OK button.or with VBA Code, only here automatically changes with the cell, the whole row and column.
Sub SetColumnsRows() With ActiveSheet.UsedRange .Columns.AutoFit .Rows.AutoFit End With end sub
Hope I could help you with this.