Copying macro

Closed
kolis29 - Mar 15, 2012 at 04:01 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 24, 2012 at 04:00 PM
Hi guys,
I'm new to macros and I need your help. I've got an excel file called "DATA.xlsm" and I need to copy some cells from another excel file, which is daily report and it's name is based on date (e.g. DR_15032012.xlsx) so each day another name. I would like to have a macro that would copy certain cells for certain date(e.g. if I need to copy data for 10th March I just place a cursor to row with this date in file "DATA.xlsm" start macro and this will copy data from file DR_10032012.xlsx to certain cells)
Is this possible?
Any help appreciated...many thanks

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 24, 2012 at 04:00 PM
Lets say if the date on the cell is already like 15032012

then you can have in macro

fileName = "DR_" & activecell

if date is not in that format
you can have some thing like this
fileName = "DR_" & format(activecell,"ddmmyyyy")
0