Guzzlr
Well-known Member
- Joined
- Apr 20, 2009
- Messages
- 982
- Office Version
- 2021
- Platform
- Windows
Code:
Sub Main_Import()
Dim sht As Integer
Dim worksheetexists As String
' Dim Wsht As Integer
ThisWorkbook.Unprotect
sht = Application.Sheets.Count
worksheetexists = False
For x = 1 To sht
If Worksheets(x).Name = "PDF2Text" Then
worksheetsexists = True
Exit For
End If
Next x
If worksheetsexists = True Then
MsgBox (" PDF2Text Tab Already Exist " _
& vbNewLine & " Please Delete PDF2Text Tab, and Run Program Again ")
Exit Sub
End If
frm_pdfimp.Show
End Sub
Hello All,
I have the following code, and I'm having issues with defining X...among others.
I'm trying to exit the sub if the worksheet: "PDF2Text" does exist. If the sheet does not exist, then the form "frm_pdfimp" shows, and the program continues.
Is there a better way to do this?
thanks for the help