|
本帖最后由 dsmch 于 2014-4-19 09:12 编辑
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Address = "$E$2" Or Target.Address = "$G$2" Then
- Union([a4:a1000], [h4:h1000]).ClearContents
- With Sheet2
- Set rng = .Rows(1).Find([E2], lookat:=xlWhole)
- If Not rng Is Nothing Then
- l = rng.Column: n = [g2]
- h = .Cells(Rows.Count, l).End(xlUp).Row
- For i = 3 To h
- Cells(i + 1, 1) = .Cells(i, l - 1)
- Cells(i + 1, "h") = .Cells(i, l) * n
- Next
- End If
- End With
- End If
- End Sub
复制代码 |
|