extracting a stringvalue from filename

  • Thread starter Thread starter solo_razor
  • Start date Start date
S

solo_razor

hello,

I have a problem, actually two.
First:
I have a filename e.g. testing-123.xls
I want to extract the filename as a string and than place this value in
a cell in the same worksheet.
Second:
I want to save a certain workbook with the date of today.
E.G.
Testing-(today date).xls

How can i program this in vba

Regards,
Niek
 
Niek,

Get filename - in the immediate window

?replace("filename.xls",".xls","")

save file

Activeworkbook.SaveAs Filename:="Testing-" & Format(Date,"dd mmm yyyy") &
".xls"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top