• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search a sheet (sheet with a date as its sheet name) with date picker

Raghu Kanth

New Member
Hi,
Im trying to search a sheet (sheet with a date as its sheet name) with date picker.
I have N number of sheets in a workbook and inserted a date picker in first sheet.
Now, can i search a sheet with date picker?
Kindly help me.
 
Depends of the format of the date in the sheet names. I've assumed like:
29Feb2016
Put the following code in the code module of the sheet with the datepicker in:
Code:
Private Sub DTPicker21_Change()
yy = Format(DTPicker21.Value, "ddmmmyyyy")
If SheetExists(yy) Then Sheets(yy).Activate
End Sub

Function SheetExists(shname)
Dim x As Worksheet
On Error Resume Next
Set x = Sheets(shname)
SheetExists = Not x Is Nothing
End Function
Also check the name of the DatePicker s right, mine was called DTPicker21.
 
Depends of the format of the date in the sheet names. I've assumed like:
29Feb2016
Put the following code in the code module of the sheet with the datepicker in:
Code:
Private Sub DTPicker21_Change()
yy = Format(DTPicker21.Value, "ddmmmyyyy")
If SheetExists(yy) Then Sheets(yy).Activate
End Sub

Function SheetExists(shname)
Dim x As Worksheet
On Error Resume Next
Set x = Sheets(shname)
SheetExists = Not x Is Nothing
End Function
Also check the name of the DatePicker s right, mine was called DTPicker21.
Thank you very much
 
Back
Top