Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
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
stop excel file opened as read only if already opened by another u bobm Excel Programming 3 August 5th 05 04:11 PM
Opening a workbook if not opened, going to it if already opened neotokyo[_3_] Excel Programming 0 September 24th 04 08:56 PM
Opening a workbook if not opened, going to it if already opened neotokyo[_2_] Excel Programming 1 September 24th 04 07:17 PM
How to see if the opened workbook is opened by another user ? balexis Excel Programming 1 August 18th 04 04:11 PM
opened workbook (not resolved question) Alex[_13_] Excel Programming 2 April 24th 04 12:37 AM


All times are GMT +1. The time now is 11:44 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"