|
以下是我自己写的,回车后没有任何响应。
请大家帮忙看一下。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i, j As Integer
j = 7
On Error Resume Next
If Target = Worksheets("Sheet1").Cells(4, 4) Then
For i = 2 To 60
If Worksheets("Sheet2").Cells(i, 3).Value = Worksheets("Sheet1").Cells(4, 4) Then
Worksheets("Sheet1").Cells(j, 3).Value = Worksheets("Sheet2").Cells(i, 2)
Worksheets("Sheet1").Cells(j, 4).Value = Worksheets("Sheet2").Cells(i, 3)
Worksheets("Sheet1").Cells(j, 5).Value = Worksheets("Sheet2").Cells(i, 4)
Worksheets("Sheet1").Cells(j, 6).Value = Worksheets("Sheet2").Cells(i, 5)
Worksheets("Sheet1").Cells(j, 7).Value = Worksheets("Sheet2").Cells(i, 6)
Worksheets("Sheet1").Cells(j, 8).Value = Worksheets("Sheet2").Cells(i, 7)
Worksheets("Sheet1").Cells(4, 4) = ""
j = j + 1
End If
Next
End If
End Sub |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|