![]() |
macro was working, now it's not working
Hello all:
I have the following macro which on clicking YES, would run th formatsummary which does some things to the "Summary" worksheet. The it adds 1 workday to cell B4 of the "Summary" worksheet. When I run the macro, I am getting a compiler error with (.Rang highlighted in yellow. Before I added the: If MsgBox("Click Yes to refresh workbook", vbYesNo) = vbYess Then ... End If The macro worked okay, now it's not working fine. Thanks for helping. Private Sub Workbook_Open() If MsgBox("Click Yes to refresh workbook", vbYesNo) = vbYess Then formatsummary With Worksheets("Summary").[b4] = workday(.Range("B4"), 1) End With End If End Su -- Message posted from http://www.ExcelForum.com |
macro was working, now it's not working
You're right, I changed the Yess to Yes,
The formatsummary macro is running okay, but then I got a debug erro when the code got to: With Worksheets("Summary") .[b4] = workday(.Range("B4"), 1) End With the .Range is highlighted in blue, while the name of the function: Private Sub Workbook_Open() is highlighted in yellow. Can you tell what's happening. Again, when I didn't have the If statement below the code ran okay: MsgBox("Click Yes to refresh workbook", vbYesNo) = vbYes Then . .. End If Thanks agai -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 05:44 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com