Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
auto selection by FILTER | Excel Discussion (Misc queries) | |||
Auto-filter selection | Excel Discussion (Misc queries) | |||
Auto selection of Data | Charts and Charting in Excel | |||
auto selection | Excel Worksheet Functions | |||
??? Combobox auto go to selection | Excel Programming |