Hello,
I have the below code and I would like to modify it to do what it does right now but to add opening a PDF file that name depends on combobox1 and the file patch varies too. Can I please have your help on this?
I have the below code and I would like to modify it to do what it does right now but to add opening a PDF file that name depends on combobox1 and the file patch varies too. Can I please have your help on this?
VBA Code:
Private Sub CommandButton1_Click()
Dim PCAR As String, oldFolderName As String, newFolderName As String, rowSelect As Long
If Me.ComboBox1.Value = "" Then
MsgBox "PR Can Not Be Blank!", vbExclamation, "PR"
Exit Sub
End If
PCAR = ComboBox1.Value
Application.ScreenUpdating = False
On Error Resume Next
rowSelect = Me.ComboBox1.ListIndex + 6
Sheets("Home").Select
Cells(rowSelect, 16) = Me.TextBox3.Value
Cells(rowSelect, 15) = "Closed"
oldFolderName = "Z:\QS\001. PR's\" & PR
newFolderName = "Z:\QS\001. PR's\" & PR & "-Closed"
Name oldFolderName As newFolderName
Unload Me
MsgBox PR & " has been closed"
Application.ScreenUpdating = True
End Sub