Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run a Macro just after i open a workbook EXCEL

Hi Guys,

i want to trigger a macro just after i open my workbook in EXCEL with
the condition that if value of cell B1 is equal to todays date trigger
the macro and written the below code.

Private Sub Workbook_Open()
MsgBox Date
If Worksheets("Sheet1").Range("B1").Value = Date Then
My_Macro
End If
End Sub

But it does not seems to be work.

Any advice or help will be appriciated.

Thanks

KAKA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Run a Macro just after i open a workbook EXCEL

What's in B1?

If you have date and time, you'll have to ignore the time:

If int(Worksheets("Sheet1").Range("B1").Value) = Date Then

Did you put the procedure in the ThisWorkbook module?

Did you allow macros to run?

Were events enabled when you opened the workbook?




wrote:

Hi Guys,

i want to trigger a macro just after i open my workbook in EXCEL with
the condition that if value of cell B1 is equal to todays date trigger
the macro and written the below code.

Private Sub Workbook_Open()
MsgBox Date
If Worksheets("Sheet1").Range("B1").Value = Date Then
My_Macro
End If
End Sub

But it does not seems to be work.

Any advice or help will be appriciated.

Thanks

KAKA


--

Dave Peterson
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
Excel macro to open a password protected workbook Stephen C Excel Discussion (Misc queries) 8 December 1st 08 05:36 AM
Open excel workbook within macro Arne Hegefors Excel Programming 3 November 8th 07 02:07 PM
Open workbook macro- find correct month to open? buzzharley[_10_] Excel Programming 8 July 8th 06 04:30 AM
Excel 2003 - Keep a Macro Running While the Workbook is Open MaxRoberts22 Excel Programming 4 January 10th 06 07:33 PM
Excel - open a new workbook with "own" macro Danny Excel Worksheet Functions 3 August 24th 05 06:51 PM


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