I am useing the bleow piece of code to define variables for filepaths and filenames.
However one of the files I am looking to define is over a 6month period and as such the file is call 'Sample Report (May 11 - Oct 11)'.
I want to try and avoid having to enter in the variable for 6 months previous (is this example 05 'May').
Is there somthing I could do to have my code define this variable based on counting back 6months from the already defined (10 'Oct')??
Sub NAPS_Date()
If TextBox25.Value = "" Then
MsgBox ("Enter Month For Report")
NoDate = True
Exit Sub
Else
NoDate = False
NapsMonth = TextBox25.Value
NapsYear = TextBox26.Value
End If
If TextBox26.Value = "" Then
MsgBox ("Enter Year For Report")
NoDate = True
Exit Sub
Else
NoDate = False
NapsMonth = TextBox25.Value
NapsYear = TextBox26.Value
End If
test = NapsMonth
Select Case NapsMonth
Case "01": FolderMonth = "01_Jan"
Case "02": FolderMonth = "02_Feb"
Case "03": FolderMonth = "03_Mar"
Case "04": FolderMonth = "04_Apr"
Case "05": FolderMonth = "05_May"
Case "06": FolderMonth = "06_Jun"
Case "07": FolderMonth = "07_Jul"
Case "08": FolderMonth = "08_Aug"
Case "09": FolderMonth = "09_Sep"
Case "10": FolderMonth = "10_Oct"
Case "11": FolderMonth = "11_Nov"
Case "12": FolderMonth = "12_Dec"
End Select
End Sub
Bookmarks