+ Reply to Thread
Results 1 to 5 of 5

Help with macro

  1. #1
    Ken G.
    Guest

    Help with macro

    I have a workbook with 2 worksheets. Each contains a column of part numbers
    with associated data. What I want to do is look at a part number in the
    second sheet and bring over some of the data for that part number from the
    first sheet.
    I know I can't use Vlookup across 2 sheets, and in any case I don't want to
    re-sort the data as required by vlookup. (its in date order, not part number
    order) I'm guessing this can only be done with a macro.
    Can anyone help?

    Thanks.

  2. #2
    Biff
    Guest

    Re: Help with macro

    Hi!

    >I know I can't use Vlookup across 2 sheets, and in any case I don't want to
    >re-sort the data as required by vlookup. (its in date order, not part
    >number
    >order)


    You can use Vlookup across sheets and the data only needs to be sorted if
    you're dealing with numeric values where there may not be an exact match.

    Can you post a small sample of data?

    Biff

    "Ken G." <[email protected]> wrote in message
    news:[email protected]...
    >I have a workbook with 2 worksheets. Each contains a column of part numbers
    > with associated data. What I want to do is look at a part number in the
    > second sheet and bring over some of the data for that part number from the
    > first sheet.
    > I know I can't use Vlookup across 2 sheets, and in any case I don't want
    > to
    > re-sort the data as required by vlookup. (its in date order, not part
    > number
    > order) I'm guessing this can only be done with a macro.
    > Can anyone help?
    >
    > Thanks.




  3. #3
    Ken G.
    Guest

    Re: Help with macro

    Thanks Biff. Don't know where I got the idea vlookup wouldn't work across two
    sheets. All done now.

    "Biff" wrote:

    > Hi!
    >
    > >I know I can't use Vlookup across 2 sheets, and in any case I don't want to
    > >re-sort the data as required by vlookup. (its in date order, not part
    > >number
    > >order)

    >
    > You can use Vlookup across sheets and the data only needs to be sorted if
    > you're dealing with numeric values where there may not be an exact match.
    >
    > Can you post a small sample of data?
    >
    > Biff
    >
    > "Ken G." <[email protected]> wrote in message
    > news:[email protected]...
    > >I have a workbook with 2 worksheets. Each contains a column of part numbers
    > > with associated data. What I want to do is look at a part number in the
    > > second sheet and bring over some of the data for that part number from the
    > > first sheet.
    > > I know I can't use Vlookup across 2 sheets, and in any case I don't want
    > > to
    > > re-sort the data as required by vlookup. (its in date order, not part
    > > number
    > > order) I'm guessing this can only be done with a macro.
    > > Can anyone help?
    > >
    > > Thanks.

    >
    >
    >


  4. #4
    chelles
    Guest

    RE: Help with macro

    How do you make the vlookup continue on down a column, basically repeating
    the same function?


    "Ken G." wrote:

    > I have a workbook with 2 worksheets. Each contains a column of part numbers
    > with associated data. What I want to do is look at a part number in the
    > second sheet and bring over some of the data for that part number from the
    > first sheet.
    > I know I can't use Vlookup across 2 sheets, and in any case I don't want to
    > re-sort the data as required by vlookup. (its in date order, not part number
    > order) I'm guessing this can only be done with a macro.
    > Can anyone help?
    >
    > Thanks.


  5. #5
    Dave Peterson
    Guest

    Re: Help with macro

    Dim myRng as range
    dim myCell as range

    with activesheet
    set myrng = .range("A1",.cells(.rows.count,"A").end(xlup))
    end with

    for each mycell in myrng.cells
    'do something to mycell
    next mycell

    is one way.

    chelles wrote:
    >
    > How do you make the vlookup continue on down a column, basically repeating
    > the same function?
    >
    > "Ken G." wrote:
    >
    > > I have a workbook with 2 worksheets. Each contains a column of part numbers
    > > with associated data. What I want to do is look at a part number in the
    > > second sheet and bring over some of the data for that part number from the
    > > first sheet.
    > > I know I can't use Vlookup across 2 sheets, and in any case I don't want to
    > > re-sort the data as required by vlookup. (its in date order, not part number
    > > order) I'm guessing this can only be done with a macro.
    > > Can anyone help?
    > >
    > > Thanks.


    --

    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