Results 1 to 3 of 3

Thread: Filling cells from a list

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    93

    Filling cells from a list

    I am using Excel 2003 and have a question about taking a list of objects and filling those objects in other cells. I will get a list like this:

    ID Animal Num
    6000 Cat 3
    7000 Dog 2
    8000 Mouse 5

    I want to be able to read the ID and the Animal and create a fill down in another part of the worksheet using the Num. What I want is below:

    6000 Cat
    6000 Cat
    6000 Cat
    7000 Dog
    7000 Dog
    8000 Mouse
    8000 Mouse
    8000 Mouse
    8000 Mouse
    8000 Mouse

    Is there an easy way to do this?

    Thanx in advance!!!

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Filling cells from a list

    you can either loop through the list and build an array for each item, then add the array into a range, or else just use a for loop to put the item into that number of rows, just need to keep count so as to know which is the next row each time
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: Filling cells from a list

    Are you trying to simply print the values in rows the no. of times as based on Num or trying to extract certain values from another location
    if latter you may use VLOOKUP()
    Last edited by VBFnewcomer; Feb 5th, 2008 at 03:18 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width