![]() |
VBA commands
I'm chasing a VBA string that will open a file which is renamed every day.
Files are identical but are renamed with "todays date". e.g. 'document 28-01-09'. OR Is there a formular which will lookup/reference this file being renamed daily. Cell location of data is identical in each file. My objective is to overwrite data in an existing "Temp" file which links to a ppt. daily presentation. Thankyou |
VBA commands
You could try VBA
Workbooks.Open Filename:="I:\Excel\Document " & Format(Date, "dd-mm-yy") & ".xls" you could try building a link in one of your worksheets using =INDIRECT("'I:\Excel\[Document "&TEXT(TODAY(),"dd-mm-yy")&".xls]Sheet1'!$A$1") but excel's native indirect function does not work on closed workbooks. You could check out Laurent Longre's Indirect.ext function included with the Morefunc addin http://xcell05.free.fr/morefunc/english/index.htm "Love2Learn" wrote: I'm chasing a VBA string that will open a file which is renamed every day. Files are identical but are renamed with "todays date". e.g. 'document 28-01-09'. OR Is there a formular which will lookup/reference this file being renamed daily. Cell location of data is identical in each file. My objective is to overwrite data in an existing "Temp" file which links to a ppt. daily presentation. Thankyou |
VBA commands
On suggestion I would make is to use yy-mm-dd as the date format. Then your
file names will sort in chronological order. Regards, Fred. "JMB" wrote in message ... You could try VBA Workbooks.Open Filename:="I:\Excel\Document " & Format(Date, "dd-mm-yy") & ".xls" you could try building a link in one of your worksheets using =INDIRECT("'I:\Excel\[Document "&TEXT(TODAY(),"dd-mm-yy")&".xls]Sheet1'!$A$1") but excel's native indirect function does not work on closed workbooks. You could check out Laurent Longre's Indirect.ext function included with the Morefunc addin http://xcell05.free.fr/morefunc/english/index.htm "Love2Learn" wrote: I'm chasing a VBA string that will open a file which is renamed every day. Files are identical but are renamed with "todays date". e.g. 'document 28-01-09'. OR Is there a formular which will lookup/reference this file being renamed daily. Cell location of data is identical in each file. My objective is to overwrite data in an existing "Temp" file which links to a ppt. daily presentation. Thankyou |
VBA commands
Yes, thanks Fred. I'm aware of the yymmdd but my primitive collegues are a
bit slow on the up-take. To make things worse they store all these files in monthly folders! I've got my work gut out. Ta. "Fred Smith" wrote: On suggestion I would make is to use yy-mm-dd as the date format. Then your file names will sort in chronological order. Regards, Fred. "JMB" wrote in message ... You could try VBA Workbooks.Open Filename:="I:\Excel\Document " & Format(Date, "dd-mm-yy") & ".xls" you could try building a link in one of your worksheets using =INDIRECT("'I:\Excel\[Document "&TEXT(TODAY(),"dd-mm-yy")&".xls]Sheet1'!$A$1") but excel's native indirect function does not work on closed workbooks. You could check out Laurent Longre's Indirect.ext function included with the Morefunc addin http://xcell05.free.fr/morefunc/english/index.htm "Love2Learn" wrote: I'm chasing a VBA string that will open a file which is renamed every day. Files are identical but are renamed with "todays date". e.g. 'document 28-01-09'. OR Is there a formular which will lookup/reference this file being renamed daily. Cell location of data is identical in each file. My objective is to overwrite data in an existing "Temp" file which links to a ppt. daily presentation. Thankyou |
VBA commands
I think I'm getting in over my head, but I'll play around with your tips.
Thanks very much. "JMB" wrote: You could try VBA Workbooks.Open Filename:="I:\Excel\Document " & Format(Date, "dd-mm-yy") & ".xls" you could try building a link in one of your worksheets using =INDIRECT("'I:\Excel\[Document "&TEXT(TODAY(),"dd-mm-yy")&".xls]Sheet1'!$A$1") but excel's native indirect function does not work on closed workbooks. You could check out Laurent Longre's Indirect.ext function included with the Morefunc addin http://xcell05.free.fr/morefunc/english/index.htm "Love2Learn" wrote: I'm chasing a VBA string that will open a file which is renamed every day. Files are identical but are renamed with "todays date". e.g. 'document 28-01-09'. OR Is there a formular which will lookup/reference this file being renamed daily. Cell location of data is identical in each file. My objective is to overwrite data in an existing "Temp" file which links to a ppt. daily presentation. Thankyou |
All times are GMT +1. The time now is 04:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com