Solved: Small Modification VBA code help needed!!
The following code worked fine for me. It create folder automatically by month and year and SaveAs word 2003 files with current date, time and Shift as a file name. I would like to add Team as the file name to my current macro script. Can someone please help me? I would really really appriciate. Thank you so much.
[VBA]
Sub Document_Open()
Me.Shift.List = Split("Day Night")
Me.Team.List = Split("A B C D")
End Sub
Private Sub CommandButton1_Click()
Dim sFileName As String
Dim sPath As String
CommandButton1.Enabled = False
sFileName = Format(DateValue(Now()), "mmm_dd_yyyy") & "_" & Shift.Value & _
Format(TimeSerial(Hour(Now()), Minute(Now()), Second(Now())), "hh_mm_ss_AM/PM")
If Len(Dir("\\C:\Common\" & Format(DateValue(Now()), "mmm_yyyy"), vbDirectory)) = 0 Then
MkDir "\\C:\Common\" & Format(DateValue(Now()), "mmm_yyyy")
End If
sPath = "\\C:\Common\" & Format(DateValue(Now()), "mmm_yyyy")
sFileName = sFileName & ".doc"
ActiveDocument.SaveAs FileName:=sPath & "\" & sFileName, FileFormat:=xlNormal, ReadOnlyRecommended:=False
MsgBox "Checklist has been saved"
ThisDocument.Close SaveChanges:=False
End Sub
[/VBA]