Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have several reports that are named using a specific naming protocol:
Center "C&A PF" Month Year Week Analyst Initials Here a few examples: Greensboro C&A PF Jan 09 wk2 lw Heathrow C&A PF Mar 09 wk3 et London C&A PF Feb 09 wk5 bm I need to extract the month from the file name and assign it to a variable, say Mnth. So for the Greensboro report Mnth = Jan. For the London report Mnth = Feb, etc. How can I do this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use Split:
Sub MonthGetter() Dim s As String s = "Greensboro C&A PF Jan 09 wk2 lw" v = Split(s, " ") MsgBox (v(3)) End Sub Split in VBA is similar to Text to Columns in the worksheet. -- Gary''s Student - gsnu200855 "Bishop" wrote: I have several reports that are named using a specific naming protocol: Center "C&A PF" Month Year Week Analyst Initials Here a few examples: Greensboro C&A PF Jan 09 wk2 lw Heathrow C&A PF Mar 09 wk3 et London C&A PF Feb 09 wk5 bm I need to extract the month from the file name and assign it to a variable, say Mnth. So for the Greensboro report Mnth = Jan. For the London report Mnth = Feb, etc. How can I do this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Suppose..
strReport = "Greensboro C&A PF Jan 09 wk2 lw" strMonth = Split(strReport)(3) If this post helps click Yes --------------- Jacob Skaria "Bishop" wrote: I have several reports that are named using a specific naming protocol: Center "C&A PF" Month Year Week Analyst Initials Here a few examples: Greensboro C&A PF Jan 09 wk2 lw Heathrow C&A PF Mar 09 wk3 et London C&A PF Feb 09 wk5 bm I need to extract the month from the file name and assign it to a variable, say Mnth. So for the Greensboro report Mnth = Jan. For the London report Mnth = Feb, etc. How can I do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extracting Specific Numbers in a String of Text | Excel Programming | |||
Extracting Data out of a string | Excel Programming | |||
extracting data from a string | Excel Worksheet Functions | |||
Formula for extracting data from a string | Excel Worksheet Functions | |||
I need help -extracting specific data | Excel Programming |