Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
abe
 
Posts: n/a
Default Can excel have a button to input (stamp) the systems date and/or .

We have a worksheet that we want users to be able to press a button on the
worksheet & which in the next cell near the button, it would stamp the
current time and/or date from the system. Then the cell with the date and/or
time would be unable to be changed once the button is pressed (locked)
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

1. First select all the cells and unlock them (Format
Cells Protection tab).
2. Go to View Toolbars and select "Control Toolbox".
3. Click on the command button icon once and draw a
button on your worksheet.
4. Right-click the button and go to "View Code". Paste in
the following:

Private Sub CommandButton1_Click()
With ActiveSheet
.Unprotect Password:="sesami"
With [J1]
.Value = Now
.NumberFormat = "mm/dd/yy h:mm AM/PM"
.Locked = True
End With
.Protect Password:="sesami"
End With
End Sub

5. Press ALT+Q.
6. Right-click on the button again, go to Properties, and
change the Caption property. Exit Properties.
6. Click on the icon "Exit Design Mode" on the Control
Toolbox toolbar.
7. Close the toolbar.

HTH
Jason
Atlanta, GA


-----Original Message-----
We have a worksheet that we want users to be able to

press a button on the
worksheet & which in the next cell near the button, it

would stamp the
current time and/or date from the system. Then the cell

with the date and/or
time would be unable to be changed once the button is

pressed (locked)
.

  #3   Report Post  
abe
 
Posts: n/a
Default

thanks, it seems to do the trick.

"Jason Morin" wrote:

1. First select all the cells and unlock them (Format
Cells Protection tab).
2. Go to View Toolbars and select "Control Toolbox".
3. Click on the command button icon once and draw a
button on your worksheet.
4. Right-click the button and go to "View Code". Paste in
the following:

Private Sub CommandButton1_Click()
With ActiveSheet
.Unprotect Password:="sesami"
With [J1]
.Value = Now
.NumberFormat = "mm/dd/yy h:mm AM/PM"
.Locked = True
End With
.Protect Password:="sesami"
End With
End Sub

5. Press ALT+Q.
6. Right-click on the button again, go to Properties, and
change the Caption property. Exit Properties.
6. Click on the icon "Exit Design Mode" on the Control
Toolbox toolbar.
7. Close the toolbar.

HTH
Jason
Atlanta, GA


-----Original Message-----
We have a worksheet that we want users to be able to

press a button on the
worksheet & which in the next cell near the button, it

would stamp the
current time and/or date from the system. Then the cell

with the date and/or
time would be unable to be changed once the button is

pressed (locked)
.


  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

Train them to use CTRL + ; to enter a static date.


Gord Dibben Excel MVP

On Wed, 9 Mar 2005 13:53:02 -0800, abe wrote:

We have a worksheet that we want users to be able to press a button on the
worksheet & which in the next cell near the button, it would stamp the
current time and/or date from the system. Then the cell with the date and/or
time would be unable to be changed once the button is pressed (locked)


  #5   Report Post  
D ][\/][ C
 
Posts: n/a
Default


abe Wrote:
We have a worksheet that we want users to be able to press a button on
the
worksheet & which in the next cell near the button, it would stamp the
current time and/or date from the system. Then the cell with the date
and/or
time would be unable to be changed once the button is pressed (locked)


You can shopw the current date and time with a macro assigned to a
button to do what you intend.

Firstly select the cell you intend using and set the date format you
want to use. Then as you start recording your macro with the cell
still selected press(CTRL+; then SPACE then CTRL+SHIFT+; ) to set the
systems current date & time, press stop on the recording toolbar. Now
select the button you intend to use from the (View,Toolbars, Forms)
menu. A list including the macro you just created will appear, assign
this macro to the button. Change the text of the button to whatever the
user will understand


--
D ][\/][ C


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default Can excel have a button to input (stamp) the systems date and/

When I tried recording such a macro, the "Stop Recording Macro" command was
not available until after confirming/entering the contents of the cell. The
macro did not record the "Ctrl + :" or the "Ctrl + Shift + ;", but rather
just entered the date, space, and time into the macro itself. Running the
macro subsequently just entered the date and time when the macro was created.
I went in and looked at the macro's code, and it looks like this:

Sub DateTimeStamp()
'
' DateTimeStamp Macro
' Macro recorded 04/24/2007 by Steve Vincent
'

'
ActiveCell.FormulaR1C1 = "4/24/2007 13:55"
Application.Goto Reference:="DateTimeStamp"
End Sub

Any suggestions of another method?



"D ][/][ C" wrote:


abe Wrote:
We have a worksheet that we want users to be able to press a button on
the
worksheet & which in the next cell near the button, it would stamp the
current time and/or date from the system. Then the cell with the date
and/or
time would be unable to be changed once the button is pressed (locked)


You can shopw the current date and time with a macro assigned to a
button to do what you intend.

Firstly select the cell you intend using and set the date format you
want to use. Then as you start recording your macro with the cell
still selected press(CTRL+; then SPACE then CTRL+SHIFT+; ) to set the
systems current date & time, press stop on the recording toolbar. Now
select the button you intend to use from the (View,Toolbars, Forms)
menu. A list including the macro you just created will appear, assign
this macro to the button. Change the text of the button to whatever the
user will understand


--
D ][\/][ C

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I input email addresses in Excel without the hyperlink, vms Excel Discussion (Misc queries) 3 February 21st 05 09:08 PM
how do i get excel to stop changing my input 5-9 to 9-May???? molly Excel Discussion (Misc queries) 3 February 20th 05 08:26 PM
How Do I open an excel file without Excel Viewer support CocoriteBallGiants Excel Discussion (Misc queries) 2 February 4th 05 10:50 PM
sharing/using/saving Excel 2002 files in Excel 2003 maze2009 Excel Discussion (Misc queries) 0 January 20th 05 07:27 PM
How do I setup a spin button in excel Andy K Excel Discussion (Misc queries) 1 November 26th 04 09:08 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"