PC Review


Reply
Thread Tools Rate Thread

capturing date for a change in a row of data

 
 
Mark
Guest
Posts: n/a
 
      25th Jul 2008
I want to capture (automatically) the date any change is made in a row of
data. Capture would be in a cell on the same row. I am not VBA proficient,
can anyone help?

Thanks

 
Reply With Quote
 
 
 
 
james.billy@gmail.com
Guest
Posts: n/a
 
      25th Jul 2008
On Jul 25, 11:52*pm, Mark <M...@discussions.microsoft.com> wrote:
> I want to capture (automatically) the date any change is made in a row of
> data. *Capture would be in a cell on the same row. *I am not VBA proficient,
> can anyone help?
>
> Thanks


You would need to enter a worksheet change event, so go to
tools>macro>visual basic editor. On the left hand side you should see
the workbook (If you don't go to View>Project explorer, from there
expand your current workbook, you should see the different worksheets
that apply to your workbook. Double click the worksheet you want this
to apply to, at the top of the code you have some dropdowns, select
worksheet in the first one and then select Change from the second one.
What you are saying is I want my code to run everytime there is a
change to the worksheet. The following should appear: Private Sub
Worksheet_Change(ByVal Target As Range) Target refers to the cell that
has changed. What you need to decide is which colum the date should
appear...

For example between the Private Sub... and End Sub... you would put:

Cells(Target.row, 5) = Date .... This would mean that in column E of
the row that has changed (E being the fifth column) the date would be
entered.

Something like...

Private Sub Worksheet_Change(ByVal Target As Range)
Cells(Target.Row, 5) = Date
End Sub

Cells is a standard notation for referencing the cell, otherwise you
would use the Range notation, in which case...

Private Sub Worksheet_Change(ByVal Target As Range)
Range("E" & Target.row) = date
End Sub

Again changing "E" to the colum you want to enter the date into, this
would do exactly the same thing, Date is a built in function in VBA.

James
 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      25th Jul 2008
Thanks, that worked really well. However....I probably over simplified it.
I want a date only if there is a change, now even a click in a cell does the
data addition. Is there anything I can do to check for an actual change or
addition?

thanks again,

Mark

"(E-Mail Removed)" wrote:

> On Jul 25, 11:52 pm, Mark <M...@discussions.microsoft.com> wrote:
> > I want to capture (automatically) the date any change is made in a row of
> > data. Capture would be in a cell on the same row. I am not VBA proficient,
> > can anyone help?
> >
> > Thanks

>
> You would need to enter a worksheet change event, so go to
> tools>macro>visual basic editor. On the left hand side you should see
> the workbook (If you don't go to View>Project explorer, from there
> expand your current workbook, you should see the different worksheets
> that apply to your workbook. Double click the worksheet you want this
> to apply to, at the top of the code you have some dropdowns, select
> worksheet in the first one and then select Change from the second one.
> What you are saying is I want my code to run everytime there is a
> change to the worksheet. The following should appear: Private Sub
> Worksheet_Change(ByVal Target As Range) Target refers to the cell that
> has changed. What you need to decide is which colum the date should
> appear...
>
> For example between the Private Sub... and End Sub... you would put:
>
> Cells(Target.row, 5) = Date .... This would mean that in column E of
> the row that has changed (E being the fifth column) the date would be
> entered.
>
> Something like...
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> Cells(Target.Row, 5) = Date
> End Sub
>
> Cells is a standard notation for referencing the cell, otherwise you
> would use the Range notation, in which case...
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> Range("E" & Target.row) = date
> End Sub
>
> Again changing "E" to the colum you want to enter the date into, this
> would do exactly the same thing, Date is a built in function in VBA.
>
> James
>

 
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
change the display data format cell already contain data as date Harun Microsoft Excel Misc 2 1st Mar 2010 11:48 AM
Change data on Date Bob Vance Microsoft Access 8 22nd Oct 2008 08:25 AM
Capturing The Date Of When Data Is Inputted =?Utf-8?B?anVzdGR1ZXQ=?= Microsoft Excel Misc 1 20th Oct 2007 07:46 PM
capturing date of entering data in a spreadsheet indivarshukla@gmail.com Microsoft Excel Programming 1 10th Nov 2006 09:19 AM
How to Change Input String Data to Date/Time Date!! =?Utf-8?B?U2lkeg==?= Microsoft Access Form Coding 3 12th Apr 2006 07:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:06 PM.