我對此代碼有問題。我試圖弄清楚它是什麼毛病此代碼,但不能找到解決Cells.find錯誤91
Sub RDB_Worksheet_To_PDF()
Dim FileName As String
Dim PONumber As String
Dim FolderPath As String
PONumber = Sheets("Purchase Order with Sales Tax").Cells(8, 6).Value
If ActiveWindow.SelectedSheets.Count > 1 Then
MsgBox "There is more then one sheet selected," & vbNewLine & _
"be aware that every selected sheet will be published"
End If
'Call the function with the correct arguments
FileName = RDB_Create_PDF(ActiveSheet, FolderPath & PONumber, True, True)
If FileName <> FolderPath & PONumber Then
'Ok, you find the PDF where you saved it
'You can call the mail macro here if you want
MsgBox "Sweet! The PO has been saved as a PDF." & vbNewLine & _
"Click on the PO Number in the PO Number WorkSheet to view."
Else
MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
"Microsoft Add-in is not installed" & vbNewLine & _
"There is no PO number selected" & vbNewLine & _
"The path to Save the file in is not correct" & vbNewLine & _
"You didn't want to overwrite the existing PDF if it exist"
End If
Sheets("PO Number").Select
Range("A1").Select
我在這部分
**Cells.Find(What:=PONumber, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate**
是不是因爲我沒有使用.activate或收到錯誤消息91我沒有使用set =? 請讓我知道我需要做什麼。
乾杯
其餘的代碼?看起來不完整的信息。 – ZAT 2014-10-07 19:44:42
其完整的信息 – Nzasianboy 2014-10-07 20:14:01