Insert New Row and Autofill Current Date (Not Time) In Column I

mkdbee

New Member
Joined
Apr 30, 2014
Messages
1
Hello There,

I have a report in Excel and am looking to track all items by their Log Date.</SPAN>

There are no dates yet in this column (I) since this is a new column added to my report.

I was hoping upon inserting a new row that the Log in Date would auto fill for users with the current date and not change if they open the report on the same day again to make changes to other columns in the same row with the current log in date </SPAN>

I’m thinking a VBA code----change event may work but the one I have tested out are not working. Any hints or suggestions?

Thank you!</SPAN>
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Change events will work to detect a new row but it is kind of a convoluted process. The way I have done this is by creating a named range somewhere very low on the sheet and every time the change event is triggered, it checks the old position of the named range and the new position. In this way, you can detect that a new row was inserted but only if it is the entire row or the named range is in the row you are inserting a new row in.

If you need help implementing this (I'm not sure if you just needed some guidance or full coding help), let us know.
 
Upvote 0
Inserting a row triggers a worksheet_change event.
Firstly I'd make sure the report data is set up as an Excel structured table.
Then in the worksheet_change event try something like:

If Intersect(activecell.row, activesheet.listobjects(1).databodyrange then
If activesheet.cells(activecell.row,1) = 0 then
activesheet.cells(activecell.row,1) = Date
end if
end if

I'd format column 1 as a date format
That should get you headed to where you want to be.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

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