extracting a stringvalue from filename

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top