Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Renaming File

Hi please help me out on this...
Everytime i save the file, the file name should be changed to test1.xls;
second time i open & save the file, the name changes to Test2.xls & so on....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Renaming File

Put a _ before the number, like Test_2, and then use

With ActiveWorkbook
iPos = InStr(.Name, "_")
iFile = Mid(.Name, iPos + 1, InStr(.Name, ".") - iPos - 1)
.SaveAs Left(.Name, iPos) & (iFile + 1) & ".xls"
End With


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Arjun Dutta" wrote in message
...
Hi please help me out on this...
Everytime i save the file, the file name should be changed to test1.xls;
second time i open & save the file, the name changes to Test2.xls & so

on....


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
Renaming a file while maintaining links Curtis Excel Worksheet Functions 2 November 7th 09 03:10 PM
VB file renaming. El Bee Excel Worksheet Functions 2 January 23rd 08 01:49 AM
Renaming A File Rose Excel Discussion (Misc queries) 2 December 14th 06 05:33 PM
Copying and renaming a file Craig Excel Discussion (Misc queries) 1 February 24th 05 10:47 PM
Renaming a file Paul C[_2_] Excel Programming 1 January 23rd 04 04:13 PM


All times are GMT +1. The time now is 09:23 AM.

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"