Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting string in groups of letters... | Excel Worksheet Functions | |||
formatting of numbers within a string | Excel Worksheet Functions | |||
Special string formatting | Excel Programming | |||
Number Formatting with string variables | Excel Programming | |||
Formatting Problem on Double-Zero String | Excel Programming |