Macro to copy 2 columns to new spreadsheet each new day

  • Thread starter Thread starter Joan
  • Start date Start date
J

Joan

Hi,
Could anyone tell me how to write a macro that will automatically
copy two colums in an Excel worksheet and at the start of each day
insert them into a new worksheet with the new date on it? The columns

in the new worksheet are named differently than the previous day's
(i.e. Beginning bag count, instead of ending bag count). I've taken
a VB programming course but have not done any programming in Excel yet.

Any help with this would be most appreciated.


Joan
 
Dim sh as Worksheet
set sh = Worksheets(Worksheets.count)
Worksheets.Add After:=sh
Worksheets(worksheets.count).Name = Format(date,"yyyymmdd")
sh.Range("A:B").Copy Worksheets(Worksheets.count).Range("A:B")
sh.Range("A1").Value = "Ending Bag Count"
sh.Range("B1").Value = "Ending Baggy Count"
 

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

Back
Top