insert new row every day.

K

kardifflad

Hello and thank you all in advance.

Is there a way to insert a new column into a spreadsheet every day an
enter the new date in the first column, then move the rest down?

So for instance i have my heading in rows 1 and 2. then freeze panes an
my date for each day in columns 3, 4, 5 and so on. What i want it to d
is every day when i open it, it moves all the data down one row an
start a new row at line 3 for that days data.
Is there a nifty bit of code that could do this please
 
A

Auric__

kardifflad said:
Is there a way to insert a new column into a spreadsheet every day and
enter the new date in the first column, then move the rest down?

So for instance i have my heading in rows 1 and 2. then freeze panes and
my date for each day in columns 3, 4, 5 and so on. What i want it to do
is every day when i open it, it moves all the data down one row and
start a new row at line 3 for that days data.
Is there a nifty bit of code that could do this please?

You could do something like this:

Sub addTodayRow()
If Cells(3, 1).Value <> Date Then
Rows("3:3").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Cells(3, 1).Value = Date
End If
End Sub

Change "1" in "Cells(3, 1)" to point at the column containing the dates.

Alternately, you could put that in the workbook's Workbook_Open event so it
happens every time the workbook is opened.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top