非空单元格作为combobox值

Private Sub UserForm_Initialize()

Rows("9:28").EntireRow.Hidden = False

Dim Maxrow As Integer

    Maxrow = Sheet1.Range("A65536").End(xlUp).Row '从下到上找到最后的非空单元格行号'

    ComboBox1.RowSource = Sheet1.Range("A7:A" & Maxrow).Address(External:=True)

Rows("9:28").EntireRow.Hidden = True

End Sub

你可能感兴趣的:(非空单元格作为combobox值)