Prev: "Hidden" worksheet?
Next: Preserving date format
From: George on 11 May 2010 09:25 Good Day, I have a date that I'm pulling from a report that is in a text string format. What i need to be able to do is extract the month from the string so that I can run a script against the month name. The format of the string is as follows. Wednesday, April 14, 2010 Thanks in advance for your help. Sam
From: Mike H on 11 May 2010 09:37 Hi, Maybe this = MID(A1, FIND(" ",A1,1)+1, FIND(" ",A1,FIND(" ",A1,1)+1)-(FIND(" ",A1,FIND(" ",A1,1)))) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "George" wrote: > Good Day, > > I have a date that I'm pulling from a report that is in a text string > format. What i need to be able to do is extract the month from the string so > that I can run a script against the month name. The format of the string is > as follows. > > Wednesday, April 14, 2010 > > Thanks in advance for your help. > Sam
From: Bernard Liengme on 11 May 2010 09:42 =MID(A1,FIND(",",A1)+2,FIND(" ",A1,FIND(",",A1)+2)-FIND(",",A1)-2) best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "George" <George(a)discussions.microsoft.com> wrote in message news:E46A0FD0-9BD9-46C6-82CC-930284756DE2(a)microsoft.com... > Good Day, > > I have a date that I'm pulling from a report that is in a text string > format. What i need to be able to do is extract the month from the string > so > that I can run a script against the month name. The format of the string > is > as follows. > > Wednesday, April 14, 2010 > > Thanks in advance for your help. > Sam
From: George on 11 May 2010 09:46 Hey Guys, Thanks for the quick response...It's exactly what I needed and works perfectly.. George "Bernard Liengme" wrote: > =MID(A1,FIND(",",A1)+2,FIND(" ",A1,FIND(",",A1)+2)-FIND(",",A1)-2) > best wishes > -- > Bernard Liengme > Microsoft Excel MVP > http://people.stfx.ca/bliengme > > "George" <George(a)discussions.microsoft.com> wrote in message > news:E46A0FD0-9BD9-46C6-82CC-930284756DE2(a)microsoft.com... > > Good Day, > > > > I have a date that I'm pulling from a report that is in a text string > > format. What i need to be able to do is extract the month from the string > > so > > that I can run a script against the month name. The format of the string > > is > > as follows. > > > > Wednesday, April 14, 2010 > > > > Thanks in advance for your help. > > Sam >
From: Charlize on 11 May 2010 09:49
VBA Code: -------------------- Sub Give_month() Dim thedate As String 'the stringdate is placed in a cell 'the cursor is located on that cell when you 'run this code thedate = Split(Trim(Split(ActiveCell.Text, ",")(1)), " ")(0) MsgBox thedate End Sub -------------------- When you want to incorporate this in your coding, replace activecell.text with the variable you are using for the loop. Charlize -- Charlize ------------------------------------------------------------------------ Charlize's Profile: http://www.thecodecage.com/forumz/member.php?u=1168 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=201922 http://www.thecodecage.com/forumz |