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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting a date/time variable to use in other modules

Status
Not open for further replies.

t16turbo

Programmer
Mar 22, 2005
315
GB
My header and footer in a worksheet created by a macro, must show the date/time that the 'start' command button was pressed.

I need to assign this to the page property:
Code:
.RightHeader = "run date/time"

in module one, I have the on_click event.
module 14 contains the createtable subroutine that eventually populates the page setup.

can anybody tell me how to do this?
thanks in advance.

 
Throw this an a module (new or existing):
Code:
[Green]'Global declaration, should appear before any
procedures in a module[/green]
Dim dteStartTime As Date

Public Property Get StartTime() As Date
  StartTime = dteStartTime
End Property

Public Property Let StartTime(ByVal dteNewValue As Date)
  dteStartTime = dteNewValue
End Property

In your On_Click event for the start command button throw this code in:
Code:
StartTime = Now

When you build the footer call the property:
Code:
.RightHeader = StartTime

Hope this helps,
CMP


Instant programmer, just add coffee.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top