Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selection of worksheet


I have a workbook with Mon-Sat worksheets. I would like it to initially
open to the appropriate day of the week worksheet based upon the
current day of the week. It must allow me to navigate between the
various sheets after the open. Can anyone offer help on this?

Thank you
Scoobydoo2006


--
scoobydoo2006
------------------------------------------------------------------------
scoobydoo2006's Profile: http://www.excelforum.com/member.php...o&userid=35372
View this thread: http://www.excelforum.com/showthread...hreadid=561303

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selection of worksheet


Hello scoobydoo2006,

From your post it looks like the worksheet names are sun, mon, tue,
etc. If this is true, this macro will work for you.

Here is the procedure to install the macro...

1) First copy the macro to the clipboard using CTRL+C.
2) Open the Workbook the macro will be run in.
3) Press ALT+F11 to open the VBA editor.
4) Press CTRL+R to display the Properties Window.
5) You should see your Worksheet names listed below the folder
"Microsoft Excel Objects". If you do see them skip to step 7.
6) Press either the Up Arrow or Down Arrow to highlight "Microsoft
Excel Objects". Press the Right Arrow key to open the folder.
7) If "ThisWorkbook" is not highlighted, use either the Up Arrow or
Down Arrow keys to highlight it.
8) Press the "Enter" key. The cursor will move to the code window.
9) Press CTRL+V to paste the macro code.
10) Press CTRL+S to Save the macro.
11) Press ALT+Q to close the VBA editor and return to Excel.


Code:
--------------------

Private Sub Workbook_Open()

ThisWorkbook.Worksheets(Format(Now, "ddd")).Activate

End Sub

--------------------


Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=561303

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selection of worksheet


I actually had the days spelled out but I changed it and your cod
works. I tried to expand it to 8-ddd... for the full name of the da
but it errored. If you know how to use the full day name please pass i
on and I will use it. If not, thanks for what you gave me.

Scoob

--
scoobydoo200
-----------------------------------------------------------------------
scoobydoo2006's Profile: http://www.excelforum.com/member.php...fo&userid=3537
View this thread: http://www.excelforum.com/showthread.php?threadid=56130

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Auto selection of worksheet

Scoobydoo2006, try 4 d's

ThisWorkbook.Worksheets(Format(Now, "dddd")).Activate


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"scoobydoo2006"
wrote in message
news:scoobydoo2006.2axt82_1152883821.5914@excelfor um-nospam.com...

I actually had the days spelled out but I changed it and your code
works. I tried to expand it to 8-ddd... for the full name of the day
but it errored. If you know how to use the full day name please pass it
on and I will use it. If not, thanks for what you gave me.

Scooby


--
scoobydoo2006
------------------------------------------------------------------------
scoobydoo2006's Profile:

http://www.excelforum.com/member.php...o&userid=35372
View this thread: http://www.excelforum.com/showthread...hreadid=561303



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selection of worksheet


Hello Scooby

Change the "ddd" to "dddd" to get the full name of the day. Here is th
code with the change..

Code
-------------------

Private Sub Workbook_Open(

ThisWorkbook.Worksheets(Format(Now, "dddd")).Activat

End Su

-------------------

Sincerely
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=56130



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selection of worksheet


Thank you! Works great!

Scooby


--
scoobydoo2006
------------------------------------------------------------------------
scoobydoo2006's Profile: http://www.excelforum.com/member.php...o&userid=35372
View this thread: http://www.excelforum.com/showthread...hreadid=561303

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selection of worksheet


This time the sheets are named by the months instead of weekdays. Trie
to alter your formula with "mmmm" but errored. Couldn't find a goo
reference for the month format. Any help is appreciated.

Scoob

--
scoobydoo200
-----------------------------------------------------------------------
scoobydoo2006's Profile: http://www.excelforum.com/member.php...fo&userid=3537
View this thread: http://www.excelforum.com/showthread.php?threadid=56130

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selection of worksheet


Hello Scooby,

The "mmmm" in the format statement will return the full month name. Can
you post your code along with the error message you receive?

Sincerely,
Leith Roaa


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=561303

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
auto selection by FILTER walrus Excel Discussion (Misc queries) 1 April 5th 10 07:47 PM
Auto-filter selection Jason W Excel Discussion (Misc queries) 1 April 1st 10 04:19 PM
Auto selection of Data Raz Charts and Charting in Excel 1 March 5th 09 08:31 AM
auto selection ekkeindoha Excel Worksheet Functions 1 June 25th 07 02:41 PM
??? Combobox auto go to selection Jaylin Excel Programming 1 January 13th 06 04:10 AM


All times are GMT +1. The time now is 12:07 AM.

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"