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: 44
Default File Name string formatting problem

I have a macro routine that processes files serially. When I save the file,
I want to format the name to a standard format. With these names below, I
want them to be changed with some Ucase in the first char postion when it
occurs, then allow for 1-6 digits with some times one leading 0, and text in
Lcase, then the file extension default to Lcase "xlsx".

Existing FName Desired FName

12345+.xlsx 12345+.xlsx 'no change needed
12345abs+.xlsx 12345abs+.xlsx "
12345t.xlsx 12345T.xlsx need UCase at
the 't'
v012345.xlsx V012345.xlsx need Ucase at the
'v'
v012345abs.xlsx V012345abs.xlsx "


I can get part of what I want with this:

FName=Activeworkbook.Name

FName = Lcase(Fname) 'need to account for Ucase and Lcase as above here
with something like Left(FName, Ucase,6, Ucase, 1, Right(lcase, ".")

'something in the wrong order or missing here

What syntax will it take to achieve the desired formats as on the right to
handle any of these generic variations that we run into? I don't find
anything similar in any of these posts.

Any links to advance handling of strings formatting like this would be great.

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
Formatting string in groups of letters... HBj[_2_] Excel Worksheet Functions 8 March 6th 09 03:49 PM
formatting of numbers within a string Edward Excel Worksheet Functions 8 November 1st 07 08:13 PM
Special string formatting christobal[_4_] Excel Programming 6 April 19th 04 05:46 PM
Number Formatting with string variables KempensBoerke Excel Programming 1 March 7th 04 03:45 AM
Formatting Problem on Double-Zero String Tom Ogilvy Excel Programming 1 July 18th 03 06:56 PM


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