Given a string, which may end with a number within braces, how can I extract as separate variables: (1) the number; (2) the string, sans the braces and number?
String examples: filename.docx
file name.pdf{10}
Given a string, which may end with a number within braces, how can I extract as separate variables: (1) the number; (2) the string, sans the braces and number?
String examples: filename.docx
file name.pdf{10}
Like this, for example:
Filename = "filename.docx"
Filename = "file name.pdf{10}"
FileNumber = Val(Mid(Filename, InStr(Filename, "{") + 1))
FileText = Split(Filename, "{")(0)