C
Cameron
Hi all,
Have the following code ..
Private Sub CommandButton1_Click()
If OptionButton1.Value = True Or OptionButton2.Value = True Then
If OptionButton1.Value = True Then SelDSet = OptionButton1.Tag
If OptionButton2.Value = True Then SelDSet = OptionButton2.Tag
Else
MsgBox "You must select a Dataset [X/Y]." _
, vbCritical + vbOKOnly, _
"Dataset Required."
OptionButton1.SetFocus
Exit Sub
End If
ResVal = MsgBox("Please confirm the following: " & Chr(13) & _
"Diary Date : " & TextBox3.Text & Chr(13) & _
"Dataset : " & SelDSet & Chr(13) _
, vbQuestion + vbYesNo + vbDefaultButton2, _
"Confirm Details.")
If ResVal = vbYes Then
Worksheets("Console Diary").Range("E2") _
= Format(TextBox3.Value, "mm/dd/yy")
Worksheets("Console Diary").Range("G2") _
= SelDSet
'************************************
Set Newbook = Workbooks.Add
fname = "\\BQL1\DATA\SHARE\ONCALL\DIARIES\Console Diary 20" &
Format(TextBox3.Value, "yymmdd") & ".xls"
Newbook.SaveAs FileName:=fname
'.Close SaveChanges:=False
'************************************
MsgBox "New Console Diary Created" & Chr(13) & "And Ready For Use.",
vbOKOnly, "Console Diary Creation Completed."
End If
End Sub
It's the last section between the '*' that I need help & direction. The new
XLS I'd like to create will contain the content and format of the "Console
Diary" Worksheet and the "Work" Worksheet, but not to contain the macro that
I've written into this XLS. How do I go about achiving this??
Copy of the XLS can be found here
Have the following code ..
Private Sub CommandButton1_Click()
If OptionButton1.Value = True Or OptionButton2.Value = True Then
If OptionButton1.Value = True Then SelDSet = OptionButton1.Tag
If OptionButton2.Value = True Then SelDSet = OptionButton2.Tag
Else
MsgBox "You must select a Dataset [X/Y]." _
, vbCritical + vbOKOnly, _
"Dataset Required."
OptionButton1.SetFocus
Exit Sub
End If
ResVal = MsgBox("Please confirm the following: " & Chr(13) & _
"Diary Date : " & TextBox3.Text & Chr(13) & _
"Dataset : " & SelDSet & Chr(13) _
, vbQuestion + vbYesNo + vbDefaultButton2, _
"Confirm Details.")
If ResVal = vbYes Then
Worksheets("Console Diary").Range("E2") _
= Format(TextBox3.Value, "mm/dd/yy")
Worksheets("Console Diary").Range("G2") _
= SelDSet
'************************************
Set Newbook = Workbooks.Add
fname = "\\BQL1\DATA\SHARE\ONCALL\DIARIES\Console Diary 20" &
Format(TextBox3.Value, "yymmdd") & ".xls"
Newbook.SaveAs FileName:=fname
'.Close SaveChanges:=False
'************************************
MsgBox "New Console Diary Created" & Chr(13) & "And Ready For Use.",
vbOKOnly, "Console Diary Creation Completed."
End If
End Sub
It's the last section between the '*' that I need help & direction. The new
XLS I'd like to create will contain the content and format of the "Console
Diary" Worksheet and the "Work" Worksheet, but not to contain the macro that
I've written into this XLS. How do I go about achiving this??
Copy of the XLS can be found here