ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Idea (https://www.excelbanter.com/excel-programming/298856-macro-idea.html)

wiinc1

Macro Idea
 
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.

Bob Phillips[_6_]

Macro Idea
 

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" wrote in message
...
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.

I appreciate the help.
Thanks.





All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com