Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim nr As Long, nc As Long
Dim str As String
nr = Target.Row
nc = Target.Column
If nr = 9 Then
With Me
If nc > 1 And nc < 5 Then
'B-D列每次选择的单元格信息保存在工作表的最后一个单元格,你也可以改变
.Cells(.Rows.Count, .Columns.Count) = Target.Address
ElseIf nc > 5 And nc < 17 Then
str = .Cells(.Rows.Count, .Columns.Count)
If str <> "" Then
.Range(str) = Target
End If
End If
End With
End If
End Sub
本回答被网友采纳