Emoncada
01-23-2008, 02:50 PM
I have this
Sub SaveForm()
Dim res As String
ActiveWorkbook.Save
res = MsgBox("Does this Spreadsheet need a Signature?", vbYesNoCancel, "Signature Request")
Select Case res
Case vbYes
FrmSignatureNames.Show
Case vbNo
If Range("AA1").Value = "Available" Then
Call SaveAvailable
Else
If Range("AA2").Value = "Retire" Then
Call SaveRetire
'-------------------------------------------------------------------------------------------------
'-------------------------------------------------------------------------------------------------
Else
If Range("AA1", "AA2").Value = "" Then
Dim fp As String, strSaveFile As String
FilePath = ""
'fp = "C:\Equipment Tracking\WIP\"
fp = "S:\Equipment Tracking\WIP\"
Call MakeFolders(fp)
Call MakeFolders(Range("K3") & "\")
Call MakeFolders(Range("K5") & "\")
Application.DisplayAlerts = False
strSaveFile = Range("B6").Value & ".xls"
Application.DisplayAlerts = True
ActiveWorkbook.SaveAs FilePath & strSaveFile, xlWorkbookNormal
FilePath = ""
'Kill ("C:\Equipment Tracking\Needs Approval\" & Range("V1").Value & "\" & Range("B6").Value & ".xls")
Kill ("S:\Equipment Tracking\Needs Approval\" & Range("V1").Value & "\" & Range("B6").Value & ".xls")
End If
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
ActiveWorkbook.Save
ActiveWorkbook.Close
Case vbCancel
Exit Sub
End Select
End Sub
It's Giving Me a problem with the VbNo case I guess because I have to many If Statements.
Is there a way I can make this work.
Sub SaveForm()
Dim res As String
ActiveWorkbook.Save
res = MsgBox("Does this Spreadsheet need a Signature?", vbYesNoCancel, "Signature Request")
Select Case res
Case vbYes
FrmSignatureNames.Show
Case vbNo
If Range("AA1").Value = "Available" Then
Call SaveAvailable
Else
If Range("AA2").Value = "Retire" Then
Call SaveRetire
'-------------------------------------------------------------------------------------------------
'-------------------------------------------------------------------------------------------------
Else
If Range("AA1", "AA2").Value = "" Then
Dim fp As String, strSaveFile As String
FilePath = ""
'fp = "C:\Equipment Tracking\WIP\"
fp = "S:\Equipment Tracking\WIP\"
Call MakeFolders(fp)
Call MakeFolders(Range("K3") & "\")
Call MakeFolders(Range("K5") & "\")
Application.DisplayAlerts = False
strSaveFile = Range("B6").Value & ".xls"
Application.DisplayAlerts = True
ActiveWorkbook.SaveAs FilePath & strSaveFile, xlWorkbookNormal
FilePath = ""
'Kill ("C:\Equipment Tracking\Needs Approval\" & Range("V1").Value & "\" & Range("B6").Value & ".xls")
Kill ("S:\Equipment Tracking\Needs Approval\" & Range("V1").Value & "\" & Range("B6").Value & ".xls")
End If
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
ActiveWorkbook.Save
ActiveWorkbook.Close
Case vbCancel
Exit Sub
End Select
End Sub
It's Giving Me a problem with the VbNo case I guess because I have to many If Statements.
Is there a way I can make this work.