View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default ecel:create a file name from data in worksheet

this should give you some ideas...........

dim sFileName as string
dim sPath as string
dim dDate as date
dim sDate as string

sFileName = "ABC"
sPath = "Z:\Susan\My Documents\DANC Rehab 2005\" '<---- change to
your path

set dDate = format( xxxxx, "ddmmyy")
' xxxx = wherever the date is set in the workbook
' you could just set a hidden cell with =today()
' and reference that

Workbooks.SaveAs Filename:=sPath & sFileName & dDate & ".xls"

untested - might have minor bugs to be worked out.
hope it helps!
susan


On Jun 3, 2:48 pm, carter30
wrote:
I wish to extract data from several workbooks that are created every day.
The daily workbooks have a common eliment in their file names Eg.
On the 1st of june the file names would be :-
ABC 010607
def 010607
on the 2nd of june the file names would be:-
ABC 020607
def 020607
I wish to create ao spread sheet that I cancreate the file name:-

ABC+"010607"
def+"010607"
The next day I would just have to update the +"******"