-1

Hi is there any VBA code for me to update the column referring to an external workbook (primary source). However the external workbook name will be changed every month as it is being downloaded at the end of each month thus the file name will be changed all the time. Is there any code that I could use to refer to this external workbook file for me to automate the update to the secondary excel file?

Community
  • 1
  • 1
Niva
  • 288
  • 1
  • 9
  • 28
  • Does your source file follow a name stardard that contain a date or similar to identify the newest version? – Andreas N. Aug 03 '15 at 07:24
  • 2
    You should post some code what you tried. – R.Katnaan Aug 03 '15 at 07:34
  • Similar but different dates as those are monthly reports, so the extension changes – Niva Aug 03 '15 at 07:40
  • then I would suggest that you write a function that loops the names and evaluate the date to return the name of the newest file. For loop of files in folder see: [loop files in folder](http://stackoverflow.com/questions/10380312/loop-through-files-in-a-folder-using-vba) – Andreas N. Aug 03 '15 at 08:02
  • ok will see to it ! Thanks – Niva Aug 03 '15 at 08:17

1 Answers1

0

Look up the Workbook.ChangeLink Method which lets you change the source workbook/worksheet of all the formulas that look at that source. This is the MS page

ChipsLetten
  • 2,923
  • 1
  • 11
  • 28