ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to create command button to save the dates and time (https://www.excelbanter.com/excel-discussion-misc-queries/63138-how-create-command-button-save-dates-time.html)

Ken Vo

How to create command button to save the dates and time
 
Hi,

I wonder if anyone can help me. I need to know how to create a command
button, when clicked it saves the spreadsheet along with the dates and time
on my desktop.

However, if that can't be done...is there a formula that lets u saves the
spreadsheet along with the dates and time. Whenever I open the same spread
sheet, the dates gets changed and my previous information of the dates are
lost - I use [= NOW()]. How can i stop this?

paul

How to create command button to save the dates and time
 
copy and paste special =now() as a value or delete =Now() and
Insert a static date or time
Current date Select a cell and press CTRL+;

Current time Select a cell and press CTRL+SHIFT+;

Current date and time Select a cell and press CTRL+; then SPACE then
CTRL+SHIFT+;





--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Hi,

I wonder if anyone can help me. I need to know how to create a command
button, when clicked it saves the spreadsheet along with the dates and time
on my desktop.

However, if that can't be done...is there a formula that lets u saves the
spreadsheet along with the dates and time. Whenever I open the same spread
sheet, the dates gets changed and my previous information of the dates are
lost - I use [= NOW()]. How can i stop this?


Ken Vo

How to create command button to save the dates and time
 
Thanks Paul,

What I really want is a formula in a command button to save the dates and
time that i have inspected a road. Whenever i open the same spread sheets,
the dates and time have changed. Can u help?

"paul" wrote:

copy and paste special =now() as a value or delete =Now() and
Insert a static date or time
Current date Select a cell and press CTRL+;

Current time Select a cell and press CTRL+SHIFT+;

Current date and time Select a cell and press CTRL+; then SPACE then
CTRL+SHIFT+;





--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Hi,

I wonder if anyone can help me. I need to know how to create a command
button, when clicked it saves the spreadsheet along with the dates and time
on my desktop.

However, if that can't be done...is there a formula that lets u saves the
spreadsheet along with the dates and time. Whenever I open the same spread
sheet, the dates gets changed and my previous information of the dates are
lost - I use [= NOW()]. How can i stop this?


paul

How to create command button to save the dates and time
 
a simple macro will do this automatically upon a click of a button otherwise
you are stuck with ctrl; ctrlshift;
--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Thanks Paul,

What I really want is a formula in a command button to save the dates and
time that i have inspected a road. Whenever i open the same spread sheets,
the dates and time have changed. Can u help?

"paul" wrote:

copy and paste special =now() as a value or delete =Now() and
Insert a static date or time
Current date Select a cell and press CTRL+;

Current time Select a cell and press CTRL+SHIFT+;

Current date and time Select a cell and press CTRL+; then SPACE then
CTRL+SHIFT+;





--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Hi,

I wonder if anyone can help me. I need to know how to create a command
button, when clicked it saves the spreadsheet along with the dates and time
on my desktop.

However, if that can't be done...is there a formula that lets u saves the
spreadsheet along with the dates and time. Whenever I open the same spread
sheet, the dates gets changed and my previous information of the dates are
lost - I use [= NOW()]. How can i stop this?


Ken Vo

How to create command button to save the dates and time
 
How do you do a simple macro?

Can u create a command button and upon a click, it spits out a staic date
and time?
Please help. Thanks.


"paul" wrote:

a simple macro will do this automatically upon a click of a button otherwise
you are stuck with ctrl; ctrlshift;
--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Thanks Paul,

What I really want is a formula in a command button to save the dates and
time that i have inspected a road. Whenever i open the same spread sheets,
the dates and time have changed. Can u help?

"paul" wrote:

copy and paste special =now() as a value or delete =Now() and
Insert a static date or time
Current date Select a cell and press CTRL+;

Current time Select a cell and press CTRL+SHIFT+;

Current date and time Select a cell and press CTRL+; then SPACE then
CTRL+SHIFT+;





--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Hi,

I wonder if anyone can help me. I need to know how to create a command
button, when clicked it saves the spreadsheet along with the dates and time
on my desktop.

However, if that can't be done...is there a formula that lets u saves the
spreadsheet along with the dates and time. Whenever I open the same spread
sheet, the dates gets changed and my previous information of the dates are
lost - I use [= NOW()]. How can i stop this?


Ken Vo

How to create command button to save the dates and time
 
I've gone through this website http://www.mcgimpsey.com/excel/timestamp.html.
I dont know how to use the code given:

Public Sub DateTimeStamp(ByVal ChangedCells As Range, _
Optional ByVal IncludeDate As Boolean = True, _
Optional ByVal IncludeTime As Boolean = True, _
Optional ByVal DTFormat As String = "dd mmm yyyy hh:mm", _
Optional ByVal RowOffset As Long = 0&, _
Optional ByVal ColOffset As Long = 1&, _
Optional ByVal ClearWhenEmpty As Boolean = True)
Const n1904 As Long = 1462
Dim bClear As Boolean
Dim rArea As Range
Dim rCell As Range

Application.EnableEvents = False
For Each rArea In ChangedCells.Areas
For Each rCell In rArea
With rCell
bClear = ClearWhenEmpty And IsEmpty(.Value)
With .Offset(RowOffset, ColOffset)
If bClear Then
.ClearContents
Else
.NumberFormat = DTFormat
.Value = Date * -IncludeDate - _
Time * IncludeTime + _
n1904 * .Parent.Parent.Date1904
End If
End With
End With
Next rCell
Next rArea
Application.EnableEvents = True
End Sub


"paul" wrote:

a simple macro will do this automatically upon a click of a button otherwise
you are stuck with ctrl; ctrlshift;
--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Thanks Paul,

What I really want is a formula in a command button to save the dates and
time that i have inspected a road. Whenever i open the same spread sheets,
the dates and time have changed. Can u help?

"paul" wrote:

copy and paste special =now() as a value or delete =Now() and
Insert a static date or time
Current date Select a cell and press CTRL+;

Current time Select a cell and press CTRL+SHIFT+;

Current date and time Select a cell and press CTRL+; then SPACE then
CTRL+SHIFT+;





--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Hi,

I wonder if anyone can help me. I need to know how to create a command
button, when clicked it saves the spreadsheet along with the dates and time
on my desktop.

However, if that can't be done...is there a formula that lets u saves the
spreadsheet along with the dates and time. Whenever I open the same spread
sheet, the dates gets changed and my previous information of the dates are
lost - I use [= NOW()]. How can i stop this?


Peo Sjoblom

How to create command button to save the dates and time
 
http://www.mvps.org/dmcritchie/excel/install.htm

--
Regards,

Peo Sjoblom

(No private emails please)


"Ken Vo" wrote in message
...
I've gone through this website
http://www.mcgimpsey.com/excel/timestamp.html.
I dont know how to use the code given:

Public Sub DateTimeStamp(ByVal ChangedCells As Range, _
Optional ByVal IncludeDate As Boolean = True, _
Optional ByVal IncludeTime As Boolean = True, _
Optional ByVal DTFormat As String = "dd mmm yyyy hh:mm", _
Optional ByVal RowOffset As Long = 0&, _
Optional ByVal ColOffset As Long = 1&, _
Optional ByVal ClearWhenEmpty As Boolean = True)
Const n1904 As Long = 1462
Dim bClear As Boolean
Dim rArea As Range
Dim rCell As Range

Application.EnableEvents = False
For Each rArea In ChangedCells.Areas
For Each rCell In rArea
With rCell
bClear = ClearWhenEmpty And IsEmpty(.Value)
With .Offset(RowOffset, ColOffset)
If bClear Then
.ClearContents
Else
.NumberFormat = DTFormat
.Value = Date * -IncludeDate - _
Time * IncludeTime + _
n1904 * .Parent.Parent.Date1904
End If
End With
End With
Next rCell
Next rArea
Application.EnableEvents = True
End Sub


"paul" wrote:

a simple macro will do this automatically upon a click of a button
otherwise
you are stuck with ctrl; ctrlshift;
--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Thanks Paul,

What I really want is a formula in a command button to save the dates
and
time that i have inspected a road. Whenever i open the same spread
sheets,
the dates and time have changed. Can u help?

"paul" wrote:

copy and paste special =now() as a value or delete =Now() and
Insert a static date or time
Current date Select a cell and press CTRL+;

Current time Select a cell and press CTRL+SHIFT+;

Current date and time Select a cell and press CTRL+; then SPACE
then
CTRL+SHIFT+;





--
paul
remove nospam for email addy!



"Ken Vo" wrote:

Hi,

I wonder if anyone can help me. I need to know how to create a
command
button, when clicked it saves the spreadsheet along with the dates
and time
on my desktop.

However, if that can't be done...is there a formula that lets u
saves the
spreadsheet along with the dates and time. Whenever I open the same
spread
sheet, the dates gets changed and my previous information of the
dates are
lost - I use [= NOW()]. How can i stop this?




All times are GMT +1. The time now is 12:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com