chead5
Active Member
- Joined
- Jun 7, 2004
- Messages
- 356
I have a dialog box that asks the user for a month (listbox, string variable) and year (another listbox, string variable).
Here is what I need to do:
I need to take the user input, and somehow loop through each day of just that month.
here is the code i have:
I can't get the end_date part. I need to set it to the last day of the month.
Any help?
Here is what I need to do:
I need to take the user input, and somehow loop through each day of just that month.
here is the code i have:
Code:
Sub create_folders()
Dim my_book As Workbook
Dim my_sheet As Worksheet
Dim i As Integer
Dim fs As Object
Dim test As Boolean
Dim year_path As String
Dim start_date As Date
Dim end_date As Date
Set fs = CreateObject("Scripting.FileSystemObject")
Set my_book = ThisWorkbook
'launch dialog box
frm_select.Show
If Module1.bln_cancel = True Then
GoTo Bye
End If
year_path = "N:\Reports_" & Module1.my_year + "\"
If fs.folderexists("n:\Reports_" & Module1.my_year) = False Then
MsgBox """N:\Reports_" & Module1.my_year + """ does not exist." & Chr(13) + "Please create it try again.", vbOKOnly, "Error"
GoTo Bye
End If
start_date = Module1.my_month + "/" + Module1.my_year
I can't get the end_date part. I need to set it to the last day of the month.
Any help?