Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Now() causes my dates to refresh automatically at inopportune times

Status
Not open for further replies.

BajanPOET

Programmer
Jul 12, 2002
194
BB
Whenever the external queries in my Excel document refresh, the date (which I have displayed using Now() changes from whatever it was to the current date. How do I get this to stop happening? Is there a way that I can automatically generate the date when the file opens but then stop it from changing once the Excel spreadsheet is saved?

What? Who? ME????
 


Hi,

In the Workbook_Open event
Code:
Worksheets([b]yoursheetname[/b].[A1].value = Date


Skip,

[glasses] [red][/red]
[tongue]
 
Silly question - how do I get to the Workbook_Open event again? ;)

What? Who? ME????
 



in the VB editor, ctl+R opens the Project Explorer.

Select the ThisWorkbook Object

Skip,

[glasses] [red][/red]
[tongue]
 
Another thing... In the above code, you've opened up brackets but never close them! Where are they supposed to close?

This is what u have
Code:
Worksheets(yoursheetname.[A1].value = Date

Thanks

What? Who? ME????
 



Sorry...
Code:
Worksheets(yoursheetname).[A1].value = Date
so if your sheet name is Sheet1...
Code:
Worksheets("Sheet1").[A1].value = Date


Skip,

[glasses] [red][/red]
[tongue]
 
Oh disregard earlier post... I looked at it again and saw where the closed bracket was! lol.

sorry heh heh lol.


What? Who? ME????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top