PDA

View Full Version : Return values from a cell



wshadow
06-16-2009, 01:47 PM
Hi everyone,

This might seem very simple, but I am really struggling right now.

This is the information from a cell:

15 7-20 * * * cnuapp ${AGD} ${AGD_MAIL} -- ${AGD_SCRIPT}/run_scheduler "run_all"


What I need is any text that goes after AFTER "run_scheduler", which is ""run_all"". "run_all" might change often for something else, so I would need a formula that gives me the values of anything after "run_scheduler".

THANKS!

Bob Phillips
06-16-2009, 02:41 PM
Try

=MID(A2,FIND("run_scheduler",A2)+LEN("run_scheduler")+1,99)

wshadow
06-16-2009, 03:05 PM
Try

=MID(A2,FIND("run_scheduler",A2)+LEN("run_scheduler")+1,99)

Thanks for your help, xld! That definitely works in excel. By any chance do you know how to do it in VBA?

This is not working for me:

Cells(1,1).Value=MID(Cells(2,1),FIND("run_scheduler",Cells(2,1))+LEN("run_scheduler")+1,99)

Thanks!

wshadow
06-16-2009, 03:58 PM
Thanks for your help, xld! That definitely works in excel. By any chance do you know how to do it in VBA?

This is not working for me:

Cells(1,1).Value=MID(Cells(2,1),FIND("run_scheduler",Cells(2,1))+LEN("run_scheduler")+1,99)

Thanks!


Cells(1,1).Value = Mid(Cells(2,1), InStr(Cells(2,1), "run_scheduler") + Len("run_scheduler") + 1, Len(Cells(2,1)))

NOW IT WORKS!!! Thanks!