Application.WorksheetFunction.Max(Sheet1.Range("A4:A1000")) '最大數(shù)值 Sub 打印() 'Sheet2.Range("A1:AC14").PrintOut Copies:=1, Collate:=True '設(shè)置打印區(qū)域 For I = 4 To 1000 Step 1 If [AE3] = Sheet1.Range("A" & I) Then '如果等于。。。 Sheet1.Range("J" & I & ":O" & I).Copy Sheet5.Range("J" & I & ":O" & I) '復(fù)制至同一個(gè)名下。。。 End If Next a = MsgBox("打印完畢,點(diǎn)擊[確定]查看是不是復(fù)制到[打印后生成數(shù)據(jù)]了?", vbYesNo, "ahaoge提示") If a = vbYes Then Sheet5.Select Else [AE3].Select End If ThisWorkbook.Save End Sub |
|