简体   繁体   中英

Automatically Expand a Drop-Down List

I have a cell with drop-down list in it. I manually press the down arrow (on the right of the cell) to show the content of the list. I need a way to automatically expand the list using VBA. How can I accomplish that?

You may try below codes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
    If Target.Cells.Count = 1 Then
        If Target.Validation.InCellDropdown = True Then
            Application.SendKeys ("%{UP}")
        End If
    End If
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM