Ponieważ byłem wolny, stworzyłem dla was przykładem
Tworzenie Userform
i umieścić ComboBox
, A RefEdit
sterowania i Label

Następnie wklej ten kod w UserForm
Private Sub UserForm_Initialize()
Dim wb As Workbook
'~~> Get the name of all the workbooks in the combobox
For Each wb In Application.Workbooks
ComboBox1.AddItem wb.Name
Next
ComboBox1 = ActiveWorkbook.Name
End Sub
'~~> This lets you toggle between all open workbooks
Private Sub Combobox1_Change()
If ComboBox1 <> "" Then Application.Workbooks(ComboBox1.Text).Activate
Label1.Caption = "": RefEdit1 = ""
End Sub
'~~> And this lets you choose the relevant range
Private Sub RefEdit1_Change()
Label1.Caption = ""
If RefEdit1.Value <> "" Then _
Label1.Caption = "[" & ComboBox1 & "]" & RefEdit1
End Sub
To właśnie otrzymujesz po uruchomieniu UserForm



użyć kontrolę REFEDIT w UserForm. Jednak musisz być bardzo ostrożny przy korzystaniu z Kontroli RefEdit, aby uzyskać zakresy z innych skoroszytów, inaczej Excel zawiesi się! Daj mi znać, jeśli chcesz mieć przykład, ponieważ jest to coś, co jest mniej znane ... –