Consulting

Results 1 to 4 of 4

Thread: Solved: VBA to do job of lookups

  1. #1
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location

    Solved: VBA to do job of lookups

    Hi

    As part of a shipping imports spreadsheet I have to create a lookup table.

    There may be, say, a total of 500 boxes arriving on a container and there may be 1000 or so rows of info on a spreadsheet indicating the box number and its contents.

    So lets say that That Column A contains the box number and column B the product code.

    If there is only one product type in a box, that box will only appear once on the list. However if there are 30 product types in a box, there will be 30 rows of info - each showing the box number and product code. So far so good?

    So what I'm looking to do is create a table on another sheet "Tabular". The macro would look at each row on the original sheet and transfer the box number to "Tabular". Then in column B on the same row it will put the 1st product it finds in box 1, then in column C it will put the second produc. D the third product, and so on.

    Once it has found all products for Box 1 it will create a new line with the next box number on the list until it has exausted all boxes and the products they contain.

    Can you help please?

    Thx

    BD
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Like this
    Attached Files Attached Files
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    Brilliant - I thought it was impossible with a formula!
    Never let it be said that Bob doesn't know the "impossible" formula
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Don't forget to update the formulae to accommodate the real range sizes.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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