第1个回答 2015-03-13
Sub xx()
Dim y
On Error Resume Next
y = Application.WorksheetFunction.Match(Range("b19"), Columns("L"), False)
Application.EnableEvents = False
If Cells(19, 2) <> "" Then Cells(y, 13) = Range("J13")
If Cells(19, 2) <> "" Then Cells(y, 14) = Range("k13")
If Cells(19, 2) <> "" Then Cells(y, 15) = Range("L13")
If Cells(19, 2) <> "" Then Cells(y, 16) = Range("M13")
If Cells(19, 2) <> "" Then Cells(y, 17) = Range("N13")
If Cells(19, 2) <> "" Then Cells(y, 18) = Range("O13")
Application.EnableEvents = True
End Sub
微调按钮指定这个宏
第2个回答 2015-03-13
Sub aaa()
If [b19] = 0 Then Exit Sub
For i = 1 To 9
If Cells(20 + i, 12) = [b19] Then
[j13:O13].Copy
Cells(20 + i, 13).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Next
Application.CutCopyMode = False
End Sub本回答被提问者采纳