Mikeymike15
New Member
- Joined
- Jul 20, 2006
- Messages
- 33
Hi guys,
My question is:
I'd like my macro to preferably select the worksheet it draws data from, based on today's date.
My workbook is updated every day with a new tab and a new set of data, so on July 2nd, I create a new sheet entitled "0702", however right now I have to go into the macro and adjust the date. I currently have another table that has a date reference (i.e. 7/2/15 which gets converted to 0702)
Thus, below, where it states Sheets("0702").select, I'd like the macro to find sheet 0702 and pick out the tab without me having to manually re-adjust the coding.
Alternatively, I wouldn't mind simply having a pop-up box ask for today's date, which would simplify my steps.
Thanks for any help,
Mike
Sub CMIShort1()
' ***************************************
' ***** CMI Desk PO Shortage Report *****
' ***************************************
' Searches for Matl Help required and pulls back every row to create a report showing oustanding PO's
Dim lastrow As Long
Dim Li As Long
lastrow = Worksheets("CMIShort").Range("A2500").End(xlUp).Row
Sheets("0702").Select
My question is:
I'd like my macro to preferably select the worksheet it draws data from, based on today's date.
My workbook is updated every day with a new tab and a new set of data, so on July 2nd, I create a new sheet entitled "0702", however right now I have to go into the macro and adjust the date. I currently have another table that has a date reference (i.e. 7/2/15 which gets converted to 0702)
Thus, below, where it states Sheets("0702").select, I'd like the macro to find sheet 0702 and pick out the tab without me having to manually re-adjust the coding.
Alternatively, I wouldn't mind simply having a pop-up box ask for today's date, which would simplify my steps.
Thanks for any help,
Mike
Sub CMIShort1()
' ***************************************
' ***** CMI Desk PO Shortage Report *****
' ***************************************
' Searches for Matl Help required and pulls back every row to create a report showing oustanding PO's
Dim lastrow As Long
Dim Li As Long
lastrow = Worksheets("CMIShort").Range("A2500").End(xlUp).Row
Sheets("0702").Select