Macro Idea

W

wiinc1

I am trying to create a macro that will do the following

Create a new colum
Label the new column with today's day (Mon) in cell C1
Label the same column with today's date (05/17/04) in cell C2
Copy and paste what is in column A3:A50 & B3:B50 into C3:C50 & D3:D50
Copy and paste values what is cells A3:A50 & B3:B50 into those same cells

The problem I am running into is

Each time I run this macro I don't want it to overwrite the old data. For the next time I ran the macro I would want the new information posted to cells E3:E50 & F3:F50

I appreciate the help
Thanks.
 
B

Bob Phillips

Try this

Dim cNextCol As Long

cNextCol = Cells(3, Columns.Count).End(xlToLeft).Column + 1
Cells(1, cNextCol).Value = Format(Date, "ddd")
Cells(2, cNextCol).Value = Format(Date, "dd/mm/yy")
Range(Cells(3, cNextCol - 2), Cells(50, cNextCol - 1)).Copy Cells(3,
cNextCol)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wiinc1 said:
I am trying to create a macro that will do the following:

Create a new column
Label the new column with today's day (Mon) in cell C1.
Label the same column with today's date (05/17/04) in cell C2.
Copy and paste what is in column A3:A50 & B3:B50 into C3:C50 & D3:D50.
Copy and paste values what is cells A3:A50 & B3:B50 into those same cells.

The problem I am running into is:

Each time I run this macro I don't want it to overwrite the old data. For
the next time I ran the macro I would want the new information posted to
cells E3:E50 & F3:F50.
 
Top