|
こんにちは
> If Target.Cells.Count > 1 Then
複数セル選択時ですか?
こういう事でしょうか?
Private Sub CommandButton1_Click()
Dim r As Range
Dim i As Long
Dim s As Worksheet
With ActiveCell
Set s = .Parent
Set r = s.Range(s.Range("AG2"), s.Range("AG2").End(xlDown))
i = ListBox1.ListIndex + 1
.Value = ListBox1.Value
s.Range("E6").Value = r(i, 2)
s.Range("E7").Value = r(i, 3)
s.Range("E8").Value = r(i, 4)
s.Range("G6").Value = r(i, 5)
s.Range("G7").Value = r(i, 6)
s.Range("G8").Value = r(i, 7)
End With
Set r = Nothing
Set s = Nothing
Unload Me
End Sub
|
|