View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey ExcelMonkey is offline
external usenet poster
 
Posts: 553
Default Regex Pattern to extract Sheet Name from .Address(external:=Tr

What is the role of the (1) and the (0)? I understand that Split will spit
the string using the delimiter and pass to an array variable. Do the numbers
in brackets denote the element of the 1D array that you wish to return the
value of?

Thanks

EM



"Rick Rothstein (MVP - VB)" wrote:

You can do what you want without using Regular Expressions...

ExternalAddress = "'[ABC.xls]Sheet1'!$C$2"
SheetName = Split(Split(ExternalAddress, "]")(1), "'")(0)

Rick


"ExcelMonkey" wrote in message
...
I need a quick way to extract the sheet name from this external address"

'[ABC.xls]Sheet1'!$C$2

A quick way would be to use a regex pattern which takes out everything
between the "]" and "!". Does anyone know what this pattern would look
like?

Any ideas?

Thanks

EM