Excel auto date.

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

danshone

Thread Starter
Joined
Sep 29, 2008
Messages
6
Hi!

Is there any way to get Excel, to automatically insert the date into the first cell in column A everytime a new row is inserted?
 
Joined
Dec 4, 2007
Messages
2,895
Dan, welcome to the forum. :)

Could you explain a little more as to what you are trying to accomplish? Also, could you attach a sample file?
 

danshone

Thread Starter
Joined
Sep 29, 2008
Messages
6
thanks for the welcome!

Where i work, we use an excel work sheet to log daily phone calls.

What happens is, everytime someone take a new call, they insert a line into the spreadsheet and add the date.

Problems have occured with people entering the wrong date or more importantly they use =today() and the date changes when the spreadsheet is reopened.

see attached if it makes more sense!

if it helps, we're using excel 2007
 

Attachments

Joined
Jul 1, 2005
Messages
8,546
danshone said:
Is there any way to get Excel, to automatically insert the date into the first cell in column A everytime a new row is inserted?
Yes, there's a way; VBA. Depends whether you want to get into that or not.

Open the attached. Make an entry in B4. Current date (according to your PC setting) appears in A4.

Right-click the sheet tab, then select "View Code" from the pop-up menu to view the code. The line Cells(Target.Row, 1) = Date does the "dating". (Press ALT+Q to return to Excel)

But then other questions arise. Will users need to make changes to column B (since that's the one we're using as the trigger) at some later date? Because that would cause column A to update, so you'd have to adapt the code to avoid that if not required. And ... if not column B, then which column should be the trigger? It would have to be one that would definitely have some value at the initial stage.

So ... it can be done, but it might be easier if you just tell users to use the "enter current date" shortcut -- CTRL+; -- to fill out column A.

HTH
 

Attachments

danshone

Thread Starter
Joined
Sep 29, 2008
Messages
6
thanks for that, it's what i was looking for. just as long as the date in column A doesn't update to tomorrows date when it is reopened.
 
Joined
Jul 25, 2004
Messages
5,458
What happens is, everytime someone take a new call, they insert a line into the spreadsheet and add the date.
Can you clarify this? Are they actually using the Insert functionality? I would hope not. Inserting is not a good thing to do. Arguably it's the next worst thing behind merging cells ever to be put into Excel. And deleting cells, muy malo. (n)

If you're saying that when they start typing on a new row (and as bomb's code works) and enter data in column B (as long as it's not on the first row of headers) the current date is entered into that row of column A (not as a formula), then bomb's solution is perfect for you.

However, be aware, there is not VBA event for the inserting or deleting of rows, and you cannot programmatically sense when this happens. Not to mention if you have formulas it destroys the dependencies created, hence formula hell.
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,612
Hi, I don't know how much you want to enter, but there a nice logging tool built into Notepad.

Create a blank txt file , name ik Telephonelog.txt
enter .LOG (it's case sensitive) as the first line and save it, PS dont forget the dot in front of the LOG.

Now everytime you open this file a timestamp is added and you can enter your text under it, save it and so on.

.LOG

23:14 06/10/2008

This would be a result if I did it now, remember by date and time settings are different than yours but you get the idea?

Try it. it's a quick and fast way, you can always use this file as input for more sophisticated reporting.
Cheers.
 
Joined
Jul 25, 2004
Messages
5,458
Keebellah, that is one of the neatest tricks I've ever seen!! Thank you very much for sharing!! Wow, awesome. :D
 
Joined
Sep 4, 2003
Messages
4,912
Instead of entering the data directly into the workbook why don't you use an input form that will transfer the data into the workbook with the correct date?

Regards,
Rollin
 

danshone

Thread Starter
Joined
Sep 29, 2008
Messages
6
Thanks for all the replys.

Bomb's solution has worked just great.

Zack, i understand what your saying about insertng lines, unfortunately, some people don't grasp that concept it it make for "interesting" call logging.

The final route forward for us will be to purchase contact management software, so this fix wont have to last long!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top