+ Reply to Thread
Results 1 to 5 of 5

syntax question

  1. #1
    Giselle
    Guest

    syntax question

    Hi XLers

    This code fragment works well, resulting in a cell value of, for example,
    Teacher

    Worksheets("PrintRpt").Range("C1").Formula =
    "=INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"


    But, I want the cell value to be Job Title: Teacher

    I know this should be simple, but I can't get the syntax to work?

    TQ for any help
    Giselle




  2. #2
    Dave Peterson
    Guest

    Re: syntax question

    Like:

    Worksheets("PrintRpt").Range("C1").Formula _
    = "=""Job title: "" & INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"

    You have to double up the quotes within the strings.

    Giselle wrote:
    >
    > Hi XLers
    >
    > This code fragment works well, resulting in a cell value of, for example,
    > Teacher
    >
    > Worksheets("PrintRpt").Range("C1").Formula =
    > "=INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"
    >
    > But, I want the cell value to be Job Title: Teacher
    >
    > I know this should be simple, but I can't get the syntax to work?
    >
    > TQ for any help
    > Giselle


    --

    Dave Peterson

  3. #3
    Giselle
    Guest

    Re: syntax question

    =" =""Why couldn't "" & ""I"" & ""think of that!"" "
    Giselle

    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Like:
    >
    > Worksheets("PrintRpt").Range("C1").Formula _
    > = "=""Job title: "" & INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"
    >
    > You have to double up the quotes within the strings.
    >
    > Giselle wrote:
    >>
    >> Hi XLers
    >>
    >> This code fragment works well, resulting in a cell value of, for example,
    >> Teacher
    >>
    >> Worksheets("PrintRpt").Range("C1").Formula =
    >> "=INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"
    >>
    >> But, I want the cell value to be Job Title: Teacher
    >>
    >> I know this should be simple, but I can't get the syntax to work?
    >>
    >> TQ for any help
    >> Giselle

    >
    > --
    >
    > Dave Peterson




  4. #4
    paul
    Guest

    Re: syntax question

    because ="=""Giselle "" &"" excel knowledge < Daves excel knowledge "" "
    --
    paul
    remove nospam for email addy!



    "Giselle" wrote:

    > =" =""Why couldn't "" & ""I"" & ""think of that!"" "
    > Giselle
    >
    > "Dave Peterson" <[email protected]> wrote in message
    > news:[email protected]...
    > > Like:
    > >
    > > Worksheets("PrintRpt").Range("C1").Formula _
    > > = "=""Job title: "" & INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"
    > >
    > > You have to double up the quotes within the strings.
    > >
    > > Giselle wrote:
    > >>
    > >> Hi XLers
    > >>
    > >> This code fragment works well, resulting in a cell value of, for example,
    > >> Teacher
    > >>
    > >> Worksheets("PrintRpt").Range("C1").Formula =
    > >> "=INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"
    > >>
    > >> But, I want the cell value to be Job Title: Teacher
    > >>
    > >> I know this should be simple, but I can't get the syntax to work?
    > >>
    > >> TQ for any help
    > >> Giselle

    > >
    > > --
    > >
    > > Dave Peterson

    >
    >
    >


  5. #5
    Dave Peterson
    Guest

    Re: syntax question

    Gawd, those double quotes are confusing!

    I sometimes type the formula in a cell, then copy and paste into the code--and
    remember to double them up after I paste.

    paul wrote:
    >
    > because ="=""Giselle "" &"" excel knowledge < Daves excel knowledge "" "
    > --
    > paul
    > remove nospam for email addy!
    >
    > "Giselle" wrote:
    >
    > > =" =""Why couldn't "" & ""I"" & ""think of that!"" "
    > > Giselle
    > >
    > > "Dave Peterson" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Like:
    > > >
    > > > Worksheets("PrintRpt").Range("C1").Formula _
    > > > = "=""Job title: "" & INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"
    > > >
    > > > You have to double up the quotes within the strings.
    > > >
    > > > Giselle wrote:
    > > >>
    > > >> Hi XLers
    > > >>
    > > >> This code fragment works well, resulting in a cell value of, for example,
    > > >> Teacher
    > > >>
    > > >> Worksheets("PrintRpt").Range("C1").Formula =
    > > >> "=INDEX(Job_List!J:J,MATCH(A4,Job_List!A:A,0))"
    > > >>
    > > >> But, I want the cell value to be Job Title: Teacher
    > > >>
    > > >> I know this should be simple, but I can't get the syntax to work?
    > > >>
    > > >> TQ for any help
    > > >> Giselle
    > > >
    > > > --
    > > >
    > > > Dave Peterson

    > >
    > >
    > >


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1