0

是否可以自动将工作簿中的所有工作表转换为新工作表?

我将 PDF 文件(29 页)转换为 excel,它成功完成,但我得到了 1 页作为 1 页(总共 29 页)

excel中是否有任何选项可以将所有这些工作表组合到工作表中。

4

1 回答 1

1

您可以通过为该工作簿编写简单的宏来做到这一点

编写宏的介绍。

http://office.microsoft.com/en-in/excel-help/introduction-to-custom-macros-in-excel-HA001118958.aspx

Dim offsetRow As Integer

Sub Button1_Click()
Dim lastrow As Integer
Dim s As Integer
Dim ws As Worksheet
Dim tmpws As Worksheet
offsetRow = 3
lastrow = 1
 ThisWorkbook.Worksheets.Add
 s = ThisWorkbook.ActiveSheet.Index
For i = 2 To ThisWorkbook.Worksheets.Count
    ThisWorkbook.Worksheets(i).Select
    ThisWorkbook.Worksheets(i).UsedRange.Copy
    ThisWorkbook.Worksheets(s).Select
    ThisWorkbook.Worksheets(s).Cells(lastrow, 1).Select
    lastrow = lastrow + ThisWorkbook.Worksheets(i).UsedRange.Rows.Count + offsetRow
    ThisWorkbook.Worksheets(s).Paste
    ThisWorkbook.Worksheets(i).Select
    'ThisWorkbook.Application.SendKeys ("{ESC}")
Next i
ThisWorkbook.Worksheets(s).Select
End Sub
于 2013-08-29T08:01:51.367 回答