LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Changing filename

I have a macro that will take data from an existing spreadsheet and copy
certain sheets into a new workbook. It then pastes these sheets as values.

What I want to do is save this new workbook and base the file name on the
original workbook and then add the text "(Values)" after it. So something in
C:\My Documents\Review For Partner.xls would then become C:\My
Documents\Review For Partner (Values).xls

A sample of the code is shown below:

Sub Macro1()
NewBookName = ThisWorkbook.FullName & " (Values)"
End Sub

The problem is that the file is called C:\My Documents\Review For
Partner.xls (Values).xls

I can see this is because when I use ThisWorkbook.FullName it produces the
answer "C:\My Documents\Review For Partner.xls"

What can I do to remove this .xls?

Thanks in advance.
 
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
changing the filename in a Link Ben Excel Discussion (Misc queries) 1 August 12th 09 04:20 PM
link to other workbook with changing filename DN Excel Worksheet Functions 6 August 30th 06 06:44 PM
Changing Filename when linked to other worksheets Amanda Excel Discussion (Misc queries) 1 October 25th 05 06:06 AM
Dynamically changing filename referenced by day Arun Hallan Excel Programming 1 July 21st 04 06:01 PM
hyperlinks-changing the filename only! gr8guy Excel Programming 4 May 29th 04 08:29 AM


All times are GMT +1. The time now is 05:35 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"