問題1:如圖1,想要在G欄位複選完後,在F欄位帶入對應L欄位的資料
問題2:如圖3,複選完後點回去要重選時會自動選取空白項目
問題3:可以的話想要將K跟L欄位放到工作表2
Private Sub ListBox1_Change()
If Reload Then Exit Sub
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then t = t & ";" & ListBox1.List(i) '分號「;」
Next
ActiveCell = Mid(t, 2)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ListBox1
If ActiveCell.Column = 7 And ActiveCell.Row > 1 Then '儲存格「欄」
j = ActiveCell.Value
Reload = True
For i = 0 To .ListCount - 1
If InStr(j, .List(i)) Then
.Selected(i) = True
Else
.Selected(i) = False
End If
Next
Reload = False
.Top = ActiveCell.Top + ActiveCell.Height
.Left = ActiveCell.Left
.Width = ActiveCell.Width
.Visible = True
Else
.Visible = False
End If
End With
End Sub