Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Calendar Control -- Is this possible?

Hi

I've a workbook which has 380 worksheets in it. 365 are for daily
records; they sheet names are their equivalent datevalue. The sheet for
today, for examplle, is called "39080."

I want to put a Calendar Control on a different worksheet so that Excel
will automatically go to the appropriate sheet for a selected date.
Obviously the 'today' value would have to be ignored unless
specifically selected.

Does anyone know if this is possible, and if so, how to do it?

Thanks

Steve

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Calendar Control -- Is this possible?

On your "control toolbox" toolbar there is an icon that looks like a hammer
and wrench. Click this an find the Calendar Control x.x to add a clendar
control to your sheet. Now add the following code to the sheet itself...

'***********************
Private Sub Calendar1_Click()
If SheetExists(Format(Calendar1.Value, "0")) Then
Sheets(Format(Calendar1.Value, "0")).Select
Else
MsgBox "Sorry but sheet " & Format(Calendar1.Value, "0") & _
" does not exist"
End If
End Sub

Public Function SheetExists(SName As String, _
Optional ByVal Wb As Workbook) As Boolean
'Chip Pearson
On Error Resume Next
If Wb Is Nothing Then Set Wb = ThisWorkbook
SheetExists = CBool(Len(Wb.Sheets(SName).Name))
End Function
'***********************

Now click the triangle and pencil icon to exit design mode and you should be
good to go...
--
HTH...

Jim Thomlinson


"Steve" wrote:

Hi

I've a workbook which has 380 worksheets in it. 365 are for daily
records; they sheet names are their equivalent datevalue. The sheet for
today, for examplle, is called "39080."

I want to put a Calendar Control on a different worksheet so that Excel
will automatically go to the appropriate sheet for a selected date.
Obviously the 'today' value would have to be ignored unless
specifically selected.

Does anyone know if this is possible, and if so, how to do it?

Thanks

Steve


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Calendar Control -- Is this possible?

Jim

This worked perfectly. Thank you.

Steve

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar control gramps Excel Discussion (Misc queries) 1 December 10th 06 11:22 PM
Removing calendar control Rob Excel Discussion (Misc queries) 0 August 4th 06 01:57 AM
Calendar Control Roleeb Excel Worksheet Functions 7 March 19th 06 09:15 AM
How to insert date using a pop up calendar control in a cell i Iain the scout Excel Discussion (Misc queries) 4 December 17th 05 08:10 PM
calendar control 10.0 timmulla Excel Discussion (Misc queries) 1 December 1st 05 12:38 AM


All times are GMT +1. The time now is 06:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"