Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default extracting a stringvalue from filename


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


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default extracting a stringvalue from filename

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)

"solo_razor" wrote in message
...

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


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filename.xls:1 and filename.xls:2 Christina C. Excel Discussion (Misc queries) 7 November 27th 07 10:39 PM
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
Add filename in a cell FreddieP Excel Discussion (Misc queries) 3 November 22nd 06 03:04 PM
+ in filename mkrefting Excel Discussion (Misc queries) 0 October 24th 06 07:44 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM


All times are GMT +1. The time now is 02:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"