What would insert automatically?
The column?
Type the date in any cell and that date would stay there?
Or go into the new column?
Into which cell in the new column?
What is the "main date cell"?
I'm struggling here as you can see.
Can we give him a macro which he can trigger with a button or shortcut key to
insert a new column and enter the date?
Sub Insert_Enter()
Selection.EntireColumn.Insert
ActiveCell.Value = Format(Now, "dd mmm yyyy")
End Sub
This will insert a column and enter in the active cell.
Gord Dibben MS Excel MVP
>Gord,
>One of the managers brought this to my attention. He is currently inserting
[quoted text clipped - 19 lines]
>> >yesterday's date, etc. If a new date is typed in, how can I set the
>> >spreadsheet to automatically insert a column for the new date?
Tara - 18 Aug 2006 01:00 GMT
Hi Gord,
I am going to need to verify with him, and have him write you back. As far
as I can tell, he has a spreadsheet that has 40 rows (1 for each employee)
and each row has several (20+) columns with dates of training classes
completed (ex. 8/17/06, 8/17/05,8/17/04,8/17/03 etc.) As an employee takes a
class they currently insert a "cell" into the spreadsheet manually and type
in the new date. He wants the spreadsheet to insert a new cell and new date
and only effect 1 row at a time. Sometimes they have several at a time to
update. (will a macro have to be set up for each row?)
He also has a conditional formatting in the "Current Date" column that turns
red when the training is outdated. He wants to have the existing formatting
in that column to move to the new column automatically. I know this is
confusing, I am sorry. Maybe I am not explaining it right.
Thank you for all your help.
Tara
> What would insert automatically?
>
[quoted text clipped - 45 lines]
> >> >yesterday's date, etc. If a new date is typed in, how can I set the
> >> >spreadsheet to automatically insert a column for the new date?
Gord Dibben - 18 Aug 2006 01:42 GMT
OK, so it's not a column he wants inserted, it is a cell inserted in a row.
Revised macro.........
Sub Insert_Enter()
Selection.Insert Shift:=xlToRight
ActiveCell.Value = Format(Now, "dd mmm yyyy")
Selection.Columns.AutoFit
End Sub
Select any cell in any row and run the macro.
Cells will be shifted to the right and date will be entered in the activecell.
No, you don't need a macro for each row.
Selection and ActiveCell cover all rows and any cell.
Gord
>Hi Gord,
>
[quoted text clipped - 63 lines]
>> >> >yesterday's date, etc. If a new date is typed in, how can I set the
>> >> >spreadsheet to automatically insert a column for the new date?
Gord Dibben MS Excel MVP
Tara - 18 Aug 2006 14:29 GMT
Thank you so much! I will pass on the information and let you know what
happens.
> OK, so it's not a column he wants inserted, it is a cell inserted in a row.
>
[quoted text clipped - 85 lines]
>
> Gord Dibben MS Excel MVP
Gord Dibben - 18 Aug 2006 01:19 GMT
Should read....
This will insert a column and enter today's date in the active cell.
Gord
>What would insert automatically?
>
[quoted text clipped - 45 lines]
>>> >yesterday's date, etc. If a new date is typed in, how can I set the
>>> >spreadsheet to automatically insert a column for the new date?
Gord Dibben MS Excel MVP