|
- Private Sub CommandButton1_Click()
- k = WorksheetFunction.Match([b1], Sheet2.[b3:b152], 0) + 2
- m = 0
- For i = 0 To 151
- If i = k - 3 Then
- Sheet2.Range("c" & k).Offset(0, i) = ""
- Else
- Sheet2.Range("c" & k).Offset(0, i) = [b4].Offset(m)
- m = m + 1
- End If
- Next
- [b4:b152].ClearContents
- End Sub
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Address(0, 0) = "B1" Then
- Application.EnableEvents = False
- Application.ScreenUpdating = False
- a = 4
- For j = 1 To 150
- If Cells(j, "m") <> [b1] Then
- Cells(a, 1) = Cells(j, "m")
- a = a + 1
- End If
- Next j
- Application.ScreenUpdating = True
- Application.EnableEvents = True
-
- End If
- End Sub
复制代码 |
|