Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date and time entry on button click
Here's an easy one:
For the spreadsheet I am developing I want to track changes on a separate sheet. On the main sheet I have added in a button that will activate the changes sheet but how do I make it so the current system date and time get populated in columns A and B in the next empty row? Thanks in advance for your help. Neal |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date and time entry on button click
bearsfan wrote: Here's an easy one: For the spreadsheet I am developing I want to track changes on a separate sheet. On the main sheet I have added in a button that will activate the changes sheet but how do I make it so the current system date and time get populated in columns A and B in the next empty row? Thanks in advance for your help. Neal First Range("A5").Select Make the cell equal to the formula <=Today() Then Range("A5").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False You copy todays date and paste it as a value so it is static. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date and time entry on button click
Sub record_it()
Dim r As Range Dim free_row As Long Worksheets("Sheet2").Activate Set r = ActiveSheet.UsedRange free_row = r.Rows.Count + r.Row Cells(free_row, 1) = Date Cells(free_row, 2) = Time End Sub This code will not write in open areas in the middle of your used range. -- Gary''s Student "bearsfan" wrote: Here's an easy one: For the spreadsheet I am developing I want to track changes on a separate sheet. On the main sheet I have added in a button that will activate the changes sheet but how do I make it so the current system date and time get populated in columns A and B in the next empty row? Thanks in advance for your help. Neal |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date and time entry on button click
Thanks for your help Gary's Student & Smarty Pants! Much appreciated.
"Gary''s Student" wrote: Sub record_it() Dim r As Range Dim free_row As Long Worksheets("Sheet2").Activate Set r = ActiveSheet.UsedRange free_row = r.Rows.Count + r.Row Cells(free_row, 1) = Date Cells(free_row, 2) = Time End Sub This code will not write in open areas in the middle of your used range. -- Gary''s Student "bearsfan" wrote: Here's an easy one: For the spreadsheet I am developing I want to track changes on a separate sheet. On the main sheet I have added in a button that will activate the changes sheet but how do I make it so the current system date and time get populated in columns A and B in the next empty row? Thanks in advance for your help. Neal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Time entry auto changes to date and then time ? | Excel Worksheet Functions | |||
Time and date each entry | Excel Programming | |||
Date and time entry | Excel Programming | |||
Auto Date/Time when click on cell | Excel Programming | |||
Double-click date entry | Excel Programming |