+ Reply to Thread
Results 1 to 3 of 3

macro for automatically generating a list from a list

  1. #1
    Registered User
    Join Date
    06-16-2010
    Location
    New York, USA
    MS-Off Ver
    Excel 2008
    Posts
    28

    macro for automatically generating a list from a list

    I think this problem will require a macro, though it might not. Basically, I have a list of values (columns A and B in attached excel sheet). In columns C and D I subtracted 15 and added 15 to the values in column B, respectively. The new list (columns E and F are what I want). What I want can best be explained with an example. Take the case of A2&B2 in list 1. I subtract 15 and add 15 to 35 (as shown in columns C and D). Then in columns E&F I want excel to start at 20 (the lower bound) and count by increments of 1 until it gets to the 50 (the upper bound). These new values need to make up the entries of the list in columns E&F. So this means it would generate the values IPI2002 20, IPI2002 21, IPI2002 22,....,IPI2002 49, IPI2002 50. Excel would do this for every entry in list 1. I badly need this formula/macro for my work. I'm struggling to figure it out, so if anyone can help, that would be awesome.

    Note: the added coloring of the cells is just to help you visualize what I mean. It does not need to be included in the final product.
    Attached Files Attached Files

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: macro for automatically generating a list from a list

    Use this macro:

    Please Login or Register  to view this content.
    Last edited by snb; 06-20-2010 at 12:45 PM.

  3. #3
    Registered User
    Join Date
    06-16-2010
    Location
    New York, USA
    MS-Off Ver
    Excel 2008
    Posts
    28

    Re: macro for automatically generating a list from a list

    I'm sorry, but I'm a little new to using macros. I opened up the VBA and pasted your code into the "ThisWorkbook" section. When I ran the macro all it did was make a long list of "VALUE!"'s. Am I doing something wrong? Could you also tell me a little about the code you wrote so I can better understand it? Thanks.

+ 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