#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!! No idea where to go next... TJaques Excel Discussion (Misc queries) 4 February 28th 07 08:22 PM
I've no idea how to do this. :( MagnoliaSouth Excel Worksheet Functions 3 June 28th 06 09:07 PM
any idea? CC Links and Linking in Excel 1 May 12th 05 12:37 AM
any idea?? NF Excel Worksheet Functions 1 April 24th 05 02:51 AM
Help Please. No Idea what to look for or how to do this David Chadwick ([email protected]) Excel Discussion (Misc queries) 0 February 28th 05 04:19 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"