我运行一个宏,该宏从PDF文件复制表格并将其保存在Excel中。一些表包含空单元格,在我的分析中,我需要知道空单元格的数量。我有一个遍历每一列的函数,以检查该单元格中的值是否为数字。麻烦的是,当我在一个空单元格上运行此函数时,它返回true。我什至尝试使用Isblank()函数手动检查单元格,它返回“ false”。(如果我在粘贴范围之外的任何单元格上尝试此操作,它将返回“ true”)
我猜想当我从PDF复制并粘贴内容时,它会以某种方式为空白单元格粘贴一些值。
有没有人遇到过类似的问题?如果是这样,关于如何解决的任何想法?
如果有帮助,这是我用来复制和粘贴的代码
'Initialize Acrobat by creating App object
Set PDFApp = CreateObject("AcroExch.App")
'Set AVDoc object
Set PDFDoc = CreateObject("AcroExch.AVDoc")
'Open the PDF
If PDFDoc.Open(PDFPath, "") = True Then
PDFDoc.BringToFront
'Maximize the document
Call PDFDoc.Maximize(True)
Set PDFPageView = PDFDoc.GetAVPageView()
'Go to the desired page
'The first page is 0
Call PDFPageView.GoTo(DisplayPage - 1)
'-------------
'ZOOM options
'-------------
'0 = AVZoomNoVary
'1 = AVZoomFitPage
'2 = AVZoomFitWidth
'3 = AVZoomFitHeight
'4 = AVZoomFitVisibleWidth
'5 = AVZoomPreferred
'Set the …Run Code Online (Sandbox Code Playgroud)