我有一个代码,它在用户表单列表框中显示范围(A1:E10)的非连续范围
Private Sub UserForm_Initialize()
Dim rng As Range
Set rng = Sheet1.Range("A1:E10")
With ListBox1
.ColumnCount = 3
.ColumnWidths = "100;100,100"
' load 1st, 3rd and 5th columns of range (A,C and E) into listbox
.List = Application.Index(rng, Evaluate("ROW(1:" & rng.Rows.Count & ")"), Array(1, 3,5))
End With
End Sub
现在我需要一个单击按钮代码来将列表框中的任何选定行检索到另一个范围(G1:I1)