+ Reply to Thread
Results 1 to 8 of 8

Sequential Fill Based on one cell value

  1. #1
    Registered User
    Join Date
    06-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Sequential Fill Based on one cell value

    Long time lurker first time poster, thanks in advance for all of the help you guys give to n00bs like me


    I'm sure this isn't that difficult to do but I can't figure out how to do it without modifying the code each time.

    Purpose Enter one value in a cell ( let's say L1 ) and everytime that number changes it will autofill the values starting with A5

    So If I enter a value of 255 in cell L1, I want it to fill Cells A5 through A259 with the values 1 through 255 respectively.

    I need it to repopulate if I enter a different number say 500 in L1 would fill A5 through A504

    Thanks for any help
    Last edited by ekasey; 06-22-2011 at 11:37 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sequential Fill Based on one cell value

    1) Put the number 1 in cell A5
    2) Right-click the sheet tab and select VIEW CODE
    3) Paste in the Worksheet_Change macro code

    Please Login or Register  to view this content.

    4) Close the VBEditor and save your workbook as a macro enabled (*.xlsm)
    5) Change the value in L1

    Each time you change L1, this macro will reassess your numeric list.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-14-2011
    Location
    Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Sequential Fill Based on one cell value

    Hello Jerry,

    Is there a formula for this? Don't know VBA hence asking!

    Jaizee

  4. #4
    Registered User
    Join Date
    06-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Sequential Fill Based on one cell value

    Jerry,

    You Rock thanks so much would have probably taken me days to figure that out!

  5. #5
    Registered User
    Join Date
    06-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Sequential Fill Based on one cell value

    Now i'm trying to figure out how to get it to write across columns instead of rows...

    Spent an hour or so trying to figure out how to get it to write across on row 5, instead of down column A, any help with what I'm missing in the code here ?

    Here's the notes I came up with

    Please Login or Register  to view this content.
    ok another update I believe I found where it is in the code

    Please Login or Register  to view this content.
    Last edited by ekasey; 06-21-2011 at 03:47 PM.

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

    Re: Sequential Fill Based on one cell value

    Answer to your first question:

    Please Login or Register  to view this content.



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

    Re: Sequential Fill Based on one cell value

    answer to your second question:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Sequential Fill Based on one cell value

    You guys rock, thanks so much

+ 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