+ Reply to Thread
Results 1 to 3 of 3

Use vba to fill in matrix in excel.

  1. #1
    jon.ingram@comcast.net
    Guest

    Use vba to fill in matrix in excel.

    I have a matrix format in excel that i need to fill in with a formula.
    I was wondering if there was any vba code that could help me with this.
    Example,

    Policy Number Name Date

    429438
    975288
    759284

    I am going to be using a lookup function to fill in name and date, I
    was hoping to get code that evaluates the # of fields and rows first
    then copies in the encompassing cells. Thanks for the help.


  2. #2
    Tom Ogilvy
    Guest

    Re: Use vba to fill in matrix in excel.

    set rng = Range(Cells(2,1),Cells(2,1).End(xldown))
    rng.offset(0,1).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,2,False))"
    rng.offset(0,2).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,3,False))"

    --
    Regards,
    Tom Ogilvy



    <jon.ingram@comcast.net> wrote in message
    news:1139771388.393556.287600@g47g2000cwa.googlegroups.com...
    > I have a matrix format in excel that i need to fill in with a formula.
    > I was wondering if there was any vba code that could help me with this.
    > Example,
    >
    > Policy Number Name Date
    >
    > 429438
    > 975288
    > 759284
    >
    > I am going to be using a lookup function to fill in name and date, I
    > was hoping to get code that evaluates the # of fields and rows first
    > then copies in the encompassing cells. Thanks for the help.
    >




  3. #3
    Tom Ogilvy
    Guest

    Re: Use vba to fill in matrix in excel.

    Got an extra ")" in there and a 4 instead of a $

    set rng = Range(Cells(2,1),Cells(2,1).End(xldown))
    rng.offset(0,1).Formula = "=Vlookup(A2,Sheet2!$A$1:$C$200,2,False)"
    rng.offset(0,2).Formula = "=Vlookup(A2,Sheet2!$A$1:$C$200,3,False)"

    --
    Regards,
    Tom Ogivly

    "Tom Ogilvy" <twogilvy@msn.com> wrote in message
    news:%23Bq1kjBMGHA.140@TK2MSFTNGP12.phx.gbl...
    > set rng = Range(Cells(2,1),Cells(2,1).End(xldown))
    > rng.offset(0,1).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,2,False))"
    > rng.offset(0,2).Formula = "=Vlookup(A2,Sheet2!$A$1:$C4200,3,False))"
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > <jon.ingram@comcast.net> wrote in message
    > news:1139771388.393556.287600@g47g2000cwa.googlegroups.com...
    > > I have a matrix format in excel that i need to fill in with a formula.
    > > I was wondering if there was any vba code that could help me with this.
    > > Example,
    > >
    > > Policy Number Name Date
    > >
    > > 429438
    > > 975288
    > > 759284
    > >
    > > I am going to be using a lookup function to fill in name and date, I
    > > was hoping to get code that evaluates the # of fields and rows first
    > > then copies in the encompassing cells. Thanks for the help.
    > >

    >
    >




+ 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