Copying macro

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
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 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
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")