#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default VB help required

I have a work book with 30 sheets (dates), first sheet is manu sheet, i
insert a calender object & a button. i just want that i click any date on
calender then click button and the sheet of selected date should be open.....
may be some vb use....please help

--
Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default VB help required

Hi,

Cute idea, never thought of that. OK, here goes:

1. Choose View, Toolbars, Control Toolbox
2. On the control toolbox click the More Controls button - the last button
3. Scroll the list and find the Calendar10 control (the number will depend
on the version of that happens to be installed on your computer), click the
control and then click in the spreadsheet.
4. Right-click the calendar and choose View Code
5. Modify the subroutine to read

Private Sub Calendar1_Click()
Dim myDay As String
myDay = Me.Calendar1.Day
Sheets(myDay).Select
End Sub

Now return to the spreadsheet and turn off Design Mode on the Control
Toolbox toolbar - the 1st tool

Now to make this work the sheets must be named 1, 2, 3, ...31 just numbers.
If you are using a different naming convention you will need to modify the
code.
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"adeel via OfficeKB.com" wrote:

I have a work book with 30 sheets (dates), first sheet is manu sheet, i
insert a calender object & a button. i just want that i click any date on
calender then click button and the sheet of selected date should be open.....
may be some vb use....please help

--
Message posted via http://www.officekb.com


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default VB help required

Thanks alot, it works....but in my work book there are month wise sheet eg.
(from 1st jun to 30th jun & from 1st july to 31st july) in first sheet i want
to add this calender and then i want if the month in this calender is June
and then i press 1 or 2 or 3.... it move to that sheet of june, similarly
when i change the month to July then press 1 or 2 or 3....it move to that
sheet of july.....

Shane Devenshire wrote:
Hi,

Cute idea, never thought of that. OK, here goes:

1. Choose View, Toolbars, Control Toolbox
2. On the control toolbox click the More Controls button - the last button
3. Scroll the list and find the Calendar10 control (the number will depend
on the version of that happens to be installed on your computer), click the
control and then click in the spreadsheet.
4. Right-click the calendar and choose View Code
5. Modify the subroutine to read

Private Sub Calendar1_Click()
Dim myDay As String
myDay = Me.Calendar1.Day
Sheets(myDay).Select
End Sub

Now return to the spreadsheet and turn off Design Mode on the Control
Toolbox toolbar - the 1st tool

Now to make this work the sheets must be named 1, 2, 3, ...31 just numbers.
If you are using a different naming convention you will need to modify the
code.
I have a work book with 30 sheets (dates), first sheet is manu sheet, i
insert a calender object & a button. i just want that i click any date on
calender then click button and the sheet of selected date should be open.....
may be some vb use....please help


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200907/1

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
Help required. CelticCharmer Excel Discussion (Misc queries) 12 October 12th 08 05:35 PM
help required gaffney2006 Excel Worksheet Functions 1 October 6th 08 11:45 AM
Help Required Safi. Excel Worksheet Functions 2 December 31st 07 11:29 PM
Help required kiran New Users to Excel 1 September 1st 05 02:27 PM
Help required Sanjeev Excel Discussion (Misc queries) 1 August 25th 05 07:59 AM


All times are GMT +1. The time now is 11:30 PM.

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

About Us

"It's about Microsoft Excel"