New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Auto populate a date in a row

Formulas, Functions, Formatting, Charts, Data Analysis, etc.

Auto populate a date in a row

Postby Perry » Tue Dec 20, 2011 2:18 pm

I tried searching, but none of the questions are exactly what I'm looking for.

I'd like there to be a cell in each row that will automatically put in today's date when I start making an entry in that row - or an adjacent cell. I'm trying to eliminate key strokes, so to use =today() is no different than just putting in the date.

Thanks in advance!
  • 0

Perry
Rookie
 
Posts: 2
Joined: Dec 20, 2011
Reputation: 0

Re: Auto populate a date in a row

Postby k0st4din » Tue Dec 20, 2011 2:38 pm

Hi
Here's a VBA code that is designed, it says something about the cells in column D - Just one right click of the mouse shows you date and time.
I hope you can help

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Target.Count > 1 Then Exit Sub
If Target.Interior.Color = RGB(255, 255, 0) Then
Target.Value = Now()
Target.NumberFormat = "dd/mm/yyyy"
Cancel = True
End If
End Sub
  • 0

So ...
1. *Consider well what is your wish.
2. *Make a sample table
3. *Describe in detail what you want to happen is to be understood, not only by yourself.
4. And if you help someone else who needs help. :) ;)
k0st4din
Excel Junkie
 
Posts: 217
Joined: Dec 7, 2011
Location: UK
Reputation: 3
Excel Version: 2003, 2007

Re: Auto populate a date in a row

Postby Perry » Wed Dec 21, 2011 5:26 pm

No, I need something that will do this:

If A1 has any letter or letters, then B1 will automatically be filled with today's date.

I need the adjacent cell to actually be filled with the date for later review.
  • 0

Perry
Rookie
 
Posts: 2
Joined: Dec 20, 2011
Reputation: 0

Re: Auto populate a date in a row

Postby k0st4din » Thu Dec 22, 2011 12:24 am

Hi,
Try this formula, if you write something in the selected column against it it will show you today. Then you can change exactly where you want to see the date.
I hope this will help you. ;)
=IF(A1<>"";TODAY();"")
  • 0

So ...
1. *Consider well what is your wish.
2. *Make a sample table
3. *Describe in detail what you want to happen is to be understood, not only by yourself.
4. And if you help someone else who needs help. :) ;)
k0st4din
Excel Junkie
 
Posts: 217
Joined: Dec 7, 2011
Location: UK
Reputation: 3
Excel Version: 2003, 2007

Re: Auto populate a date in a row

Postby Sisyphus » Thu Dec 22, 2011 3:41 am

Hi,

I have often programmed sheets to add a row at the bottom. You can make all kinds of rules for the new row. It may have formulae in it, for example the formula k0st4din has suggested, or a date, or a serial number, or all the formulae in the preceding or top row or other repetitive date. Sometimes I have made a button to trigger the action, sometimes the trigger is just to put the cursor in the next row, or anywhere below the last row. Such a macro isn't complicated and, once installed, needs no maintenance. But it can be quite a nuisance if Excel automatically puts the cursor in the trigger cell at the end of the last row even while you don't want a new row (with a date) just yet.

By much the same process a date can be put in B1 when you start typing in A1. But the code that does that particular job will be of no use to you when you want to write in another row or another pair of cells, and it will not copy easily from A to D the way formulae do, unless you know VB code which, if it were the case, wouldn't let you ask your question. So, to help you out with this code you would need to specify precisely, in a generic way, what you want to do.

Tell us about the 'trigger' cell. Is it always in column A? Is it always in the last row, or always in a new row, or can any cell (in column A?) trigger an entry somewhere else? Or is the trigger always to the right or left, above or below (removed by how many cells?) from the target cell? Can only a blank cell serve as trigger? Can a cell in the header serve as trigger? If not, how many rows does your header have? Same questions for rows below the body of your sheet, for example totals, the presence of which would preclude finding the "next" row unless that row is inserted above the total rows, in which case the number of rows of totals needs to be known either absolute or by generic description, and the trigger might, in that case, be - for example - the cell in column A which was just inserted, like, you insert a new row, place the cursor in cell A?? and the date appears in B?? while placing the cursor in any other cell in column A produces no action at all.

Tell us about the target cell in the same manner. Remember to mention if you would want a date already written in the target cell to be over-written?

If you feel it is easier to input the date than to answer the questionaire that might lead to code I may have done my job well. :lol:

Enjoy this season!
  • 0

Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010


Return to General Excel Questions

Who is online

Users browsing this forum: No registered users and 257 guests