Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Date and Time

  Asked By: Diem    Date: Jan 02    Category: MS Office    Views: 723
  

(Q1):
Can I make the date and time update every second on frmTable.Caption?

code:
-----
Private Sub UserForm_Activate()

frmTable.Caption = "East Coast Seafood " & Now()

End Sub

(Q2):
Can I add one worksheet with the name is Date of the day?
Code below shown error because the worksheets.name not able to
accept "/.%,&,#" as name.How can I solve this?

Main puspose: I needed to save the worksheets everyday on the same
workbook.Thus, I want my worksheet's name is the Date of the day.

code:
-----
Sub BusinessEnd()
Dtime = Now()
Worksheets.Add Before:=Worksheets("Past Database")
Worksheets(Worksheets.Count - 1).Name = Dtime
Sheets("Past Database").Select
Cells.Select
Selection.Copy
Sheets(Dtime).Select
ActiveSheet.Paste

End Sub

Share: 

 

7 Answers Found

 
Answer #1    Answered By: Femke Bakker     Answered On: Jan 02

> (Q1):
Look at...
support.microsoft.com/default.aspx?scid=http://support.microsoft.com:
80/support/kb/articles/q180/7/36.asp&NoWebContent=1

> (Q2):
You simply cannot use those characters in the name. Try a dash "-"...
20-07-2007, or a short text date  like.... Mon 12th July

> Main puspose: I needed  to save  the worksheets  everyday on the
> same workbook.
You are going to have a LOT of worksheets and it's very likely that you
won't see the date anyway!
Try splitting the workbooks up into week numbers... 7 or 5 sheets per
workbook, with links to each in a main worksheet  or web page.

 
Answer #2    Answered By: Adalhelm Fischer     Answered On: Jan 02

"Try splitting the workbooks up into week numbers... 7 or 5 sheets
perworkbook, with links to each in a main worksheet  or web page."

I have the same idea with you,but i don't how to link the workbook to
worksbook. if link between worksheet then i know a bit. Can you
please give me some idea?pls advice.

 
Answer #3    Answered By: Tyreece Thompson     Answered On: Jan 02

You wouldn't actually link a workbook. Set a hyperlink to a sheet in the
workbook.... Probably the first one.

First you'd build the 50 od sheets for each week... Could be 12 for each
month maybe... I'd try both and see which one I / my users prefered.
Then start up another workbook and Insert / Hyperlink ... and point to the
first sheet in the workbook.

So for example... I'd have my new workbook open and then open week ones
workbook. Then Insert / Hyperlink into my new sheet and point to say A1 of
Sunday.

OTOH... You could have a list of the workbooks in a range, select one and
click a button to open it.

 
Answer #4    Answered By: Drew Lewis     Answered On: Jan 02

on question 1 yes you can but the form and update  will be very time  intensive
and probably should not be done at least on a second by second basis.. minutes
ok shouldn't hurt time as much...

on question 2.. you would use the format function like this

worksheet.name = format(date(now), "mm-dd-yy") that would name the worksheet  as
12-10-07....

 
Answer #5    Answered By: Adalard Fischer     Answered On: Jan 02

By the ways can you provide me some code
regarding the Q1.?

 
Answer #6    Answered By: Paulette Matthews     Answered On: Jan 02

Complie error  on the "worksheets.name = format(date(now), "mm-dd-
yy")

 
Answer #7    Answered By: Wanda Patterson     Answered On: Jan 02

worksheets(number).name = format(date(now), "mm-dd-yy") replace the (number)
with either the sheet number in the book or the current name of the sheet i.e.
worksheet(1) or worksheets("sheet2") etc for the first one.. if there is only
one sheet in the book then its 1 if there is more than one.. it would be a
little harder to figure out.. i'd stay with the "Sheet1" version

 
Didn't find what you were looking for? Find more on Date and Time Or get search suggestion and latest updates.




Tagged: