Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
When excel is opened need to ask a question
What day of the week it is and open a certian workbook and run a
certain macro. New to this and need some help. Do now somewhat about vb that works inside of excel. I would be Thankful for any help.. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
When excel is opened need to ask a question
Press Alt + F11 to open the VBE, then double click ThisWorkbook in the projet
window located upper left in the VBE window. After you add your macro name to the code below, paste it into the ThisWorkbook code window. When you open that workbook, the code will run. The macro you call must be in the standard code module1. Private Sub Workbook_Open() MsgBox "This is " & Format(Date, "dddd, d, m") Call 'macro name End Sub If the macro takes arguments the arguments must be included in partheses, otherwise, omit the parentheses. " wrote: What day of the week it is and open a certian workbook and run a certain macro. New to this and need some help. Do now somewhat about vb that works inside of excel. I would be Thankful for any help.. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
When excel is opened need to ask a question
It isn't at all clear what you are asking. If you mean that you want
to run a procedure depending on what day of the week it is, use code like the following: Sub Auto_Open() Select Case Weekday(Now, vbSunday) Case 1 'sunday ' run procedure 1 Case 2 'monday ' run procedure 2 Case 3 'tuesday ' run procedure 3 '... as so on to 7 = Saturday End Select End Sub Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Wed, 31 Dec 2008 09:19:05 -0800 (PST), wrote: What day of the week it is and open a certian workbook and run a certain macro. New to this and need some help. Do now somewhat about vb that works inside of excel. I would be Thankful for any help.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
stop excel file opened as read only if already opened by another u | Excel Programming | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
How to see if the opened workbook is opened by another user ? | Excel Programming | |||
opened workbook (not resolved question) | Excel Programming |