Data entry to different cell when date changes

bharath.blitz

New Member
Joined
May 26, 2011
Messages
11
Hi Experts,

My problem is interesting and i need your expert help on that. My issue

1) When i enter data (number) in D5 in Sheet 1, I want that data to appear in another sheet (D5 in Sheet2) with date and time in adjacent cells - This i was able to acheive through macros

2) Now issue is when i open the excel tomorrow and enter new data in D5 in sheet 1, I want this number to appear in D6-Sheet 2, that is one cell below yesterdays data, without overwriting yesterday's data

3) Like this when i change data in D5 Sheet1 everyday, the data should get stored in sheet 2, everyday in onc cell below previous day's data. So that when i go to sheet 2, i can see a months data in one place

Is it complex to acheive this??:confused: I am stuck here. Experts please help
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the board. Something like this?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Last_Row As Long
If Target.Address = "$D$5" Then
    
    With Sheets("Sheet2")
        Last_Row = .Range("D" & Rows.Count).End(xlUp).Offset(1).Row
        .Cells(Last_Row, 4) = Sheets("Sheet1").Range("D5").Value
        .Cells(Last_Row, 5) = Now
    End With
End If
    

End Sub
 
Upvote 0
That was real quick. Thanks Neil :)
-----------

I entered your code in sheet 1 and entered data in D5, but nothing appeared in sheet 2?? What am i doing wrong :confused:

Please pardon me, I am amateur in macros, I am building an inventory tool where this is required.
 
Upvote 0
Did you definitely paste the code into the module of the sheet that you will be entering data into D5?
 
Upvote 0
No, the code won't fire unless events are enabled. From the VBE, press Ctrl+G to display the Immediate window. Then enter the below code:
Application.EnableEvents = True
 
Upvote 0
Done but still :(. Can you please PM me the dummy excel with that code...let me have a look at it. Thank a lot for your help.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
Lawrenceiow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top