|
这个是具体的,在vba中看代码
- Sub 生成文档()
- nnn = 1
- n = 2
- kk = 8
- For x = 2 To 4
-
- Sheet3.[a3] = "NO:" & Sheet1.Cells(x, 1)
- Sheet3.[b4] = Sheet1.Cells(x, 2)
- Sheet3.[d5] = Sheet1.Cells(x, 3)
- Sheet3.[d4] = Sheet1.Cells(x, 4)
- Sheet3.[h4] = Sheet1.Cells(x, 5)
- Sheet3.[b6] = Sheet1.Cells(x, 6)
- Sheet3.[b5] = Sheet1.Cells(x, 7)
- Sheet3.[d6] = Sheet1.Cells(x, 8)
- Do
- Sheet3.Cells(kk, 1) = Sheet2.Cells(n, 2)
- Sheet3.Cells(kk, 2) = Sheet2.Cells(n, 4)
- Sheet3.Cells(kk, 3) = Sheet2.Cells(n, 5)
- Sheet3.Cells(kk, 4) = Sheet2.Cells(n, 6)
- Sheet3.Cells(kk, 5) = Sheet2.Cells(n, 7)
- Sheet3.Cells(kk, 6) = Sheet2.Cells(n, 8)
- Sheet3.Cells(kk, 7) = Sheet2.Cells(n, 9)
- n = n + 1
- kk = kk + 1
- Loop While (Sheet1.Cells(x, 1) = Sheet2.Cells(n, 1)) And n < 8
- kk = 8
- Sheet3.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.Path & "\万一\实验" & nnn & ".pdf", OpenAfterPublish:=False
- nnn = nnn + 1
-
- Next x
- End Sub
复制代码 |
|