RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 810
- Office Version
- 365
- Platform
- Windows
Hi guys,
Got this string:
I need
The string can also be like:
Or many different variations. The common theme is that every string will have a final backslash and then either "Mailing" or "mailing"
I need what is in between, either "60. LG Vitalic" or "83. LG Digitalism" etc.
This is my code:
On some it works ok, like "60. LG Vitalic", but on others it gives an error on the "camnam =" line (Invalid Procedure Call or Argument)
If anyone knows a better way to get what's between the final "" and the "ailing " I would really appreciate it
Thanks!
Got this string:
Code:
\\chw-dc03\company\Sales\Faculty Documents\2019 Mailing Lists\64. LG XX Flying Scotsman Mailing list - 2019-06-12.csv
I need
Code:
64. LG XX Flying Scotsman
The string can also be like:
Code:
\\chw-dc03\company\Sales\Faculty Documents\2019 Mailing Lists\60. LG Vitalic mailing_list - 2019-06-01.csv
\\chw-dc03\company\Sales\Faculty Documents\2019 Mailing Lists\7. SV29 Mailing List - 2019-02-04.csv
\\chw-dc03\company\Sales\Faculty Documents\2019 Mailing Lists\38. LG Digitalism Mailing List - 2019-04-08.csv
Or many different variations. The common theme is that every string will have a final backslash and then either "Mailing" or "mailing"
I need what is in between, either "60. LG Vitalic" or "83. LG Digitalism" etc.
This is my code:
Code:
Range("B60").Value = facml
Str = Right(facml, Len(facml) - InStrRev(facml, "\", , 1))
Range("D4").Value = Str
spos = InStr(1, facml, "ists\") + 5
epos = InStr(spos, facml, "ailing_") - 2
camnam = Mid(facml, spos, epos - spos)
Range("B61") = camnam
On some it works ok, like "60. LG Vitalic", but on others it gives an error on the "camnam =" line (Invalid Procedure Call or Argument)
If anyone knows a better way to get what's between the final "" and the "ailing " I would really appreciate it
Thanks!
Last edited: