bamaisgreat
Well-known Member
- Joined
- Jan 23, 2012
- Messages
- 831
- Office Version
- 365
- Platform
- Windows
I have a form that opens up everytime the workbook is opened. In the code below it does a save as, when this happens I need the New Workbook to not have this form opening up . Im not sure if Im real clear on this but however I just don't need that form in the new workbook but I do need to keep all the modules. Thanks
Code:
Private Sub Workbook_Open()
Worksheets("Application").Activate
frmApplication.Show
End Sub
Code:
Worksheets("Application").Cells(115, 2).Value = Me.txtfinaldate.Value
Worksheets("Application").Cells(115, 6).Value = Me.txtsignature.Value
Sheets("Application").Copy
Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs Filename:="H:\All\Application\Applications Completed\" & _
Format(Now(), "mm-dd-yyyy hh-mm-ss") & " NEW APPLICATION " & Sheets("Application").Range("C5"), FileFormat:=xlNormal
.Close
End With
Range("A1:J1").Select
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "ComboBox" Then
ctl.Value = ""
End If
Next ctl
frmApplication.TextBox1.SetFocus
Worksheets("Application").Range("A5:B5").Select