PC Review


Reply
Thread Tools Rate Thread

Date and time entry on button click

 
 
=?Utf-8?B?YmVhcnNmYW4=?=
Guest
Posts: n/a
 
      19th Oct 2006
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 With Quote
 
 
 
 
SmartyPants
Guest
Posts: n/a
 
      19th Oct 2006

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.

 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      19th Oct 2006
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 With Quote
 
=?Utf-8?B?YmVhcnNmYW4=?=
Guest
Posts: n/a
 
      19th Oct 2006
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I time/date stamp an entry in a note from a calendar entry? Sweet Microsoft Outlook Calendar 1 2nd Apr 2010 07:33 PM
on click time entry John Microsoft Access Getting Started 0 15th Apr 2009 06:55 PM
automatic date & time for button-click Kyle Microsoft Access 4 30th Jan 2006 05:33 PM
Double-click date entry RJH Microsoft Excel Programming 2 30th Jan 2004 04:41 PM
Data Entry Restrictions & Date/Time Entry =?Utf-8?B?S01jR2Vl?= Microsoft Excel Misc 3 30th Dec 2003 05:58 PM


Features
 

Advertising
 

Newsgroups
 


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