+ Reply to Thread
Results 1 to 11 of 11

auto fill rows based on number and formula

  1. #1
    Registered User
    Join Date
    11-18-2012
    Location
    Pville,LA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Question auto fill rows based on number and formula

    Looking for a way that will auto fill rows on sheet1 based off value in cells B5:B13

    ex: B5 = 10 (or whatever number entereed) and on sheet1 rows 2-12 in columnA would be filled in based on the following:
    first cell would be 4000 and each cell after would add 400 to the previous so that row12 would read 7600

    attached worksheet but manually entered values on sheet 1
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: auto fill rows based on number and formula

    Getting the 4000 start and 400 increase is fairly simple, but where the "B5 = 10 (or whatever number entereed) " part come in?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-18-2012
    Location
    Pville,LA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: auto fill rows based on number and formula

    B5 would be on the land calc page, so if you would enter 10 in that cell then it would autofill on sheet1 column A cells B3-B12

    current value on the Land Calculator.xlsx is currently 10,000 so really column A on sheet1 cells A3-A10002 would autofill starting @ 4000 and then 400 increase so the last value in sheet1 A10002 would be 4,003,600

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: auto fill rows based on number and formula

    THis is probably far too simplistic, but it may give us a starting point.

    In sheet1 A3, use this...
    =IF('Land Calc'!B5=10000,4000,"")
    then in A4, copied down, use this...
    =IF(A3="","",A3+400)

  5. #5
    Registered User
    Join Date
    11-18-2012
    Location
    Pville,LA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: auto fill rows based on number and formula

    Quote Originally Posted by FDibbins View Post
    THis is probably far too simplistic, but it may give us a starting point.

    In sheet1 A3, use this...
    =IF('Land Calc'!B5=10000,4000,"")
    then in A4, copied down, use this...
    =IF(A3="","",A3+400)
    this is the same as i have already done just used 4000 in A2 and then copied down =A2+400

    what i need is to do this automatically, figured it would be a script or macro or something.

    'Land Calc'!B5 would fill in Sheet1 Column A
    'Land Calc'!B6 would fill in Sheet1 Column B
    'Land Calc'!B7 would fill in Sheet1 Column C
    etc....

    so really 'Land Calc'!B5:B13 could be considered the rows that need to filled in on the corresponding column

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: auto fill rows based on number and formula

    OK thought it was too easy lol.

    Try this in sheet2 A3, copied across...
    =OFFSET('Land Calc'!$B$4,COLUMN(),0)

  7. #7
    Registered User
    Join Date
    11-18-2012
    Location
    Pville,LA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: auto fill rows based on number and formula

    Quote Originally Posted by FDibbins View Post
    OK thought it was too easy lol.

    Try this in sheet2 A3, copied across...
    =OFFSET('Land Calc'!$B$4,COLUMN(),0)
    that just returns the same values on land calc page

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: auto fill rows based on number and formula

    'Land Calc'!B5 would fill in Sheet1 Column A = 10,000
    'Land Calc'!B6 would fill in Sheet1 Column B = 4,310
    'Land Calc'!B7 would fill in Sheet1 Column C = 4,640


    Sorry, to me, thats what it looked like you asked for?

    Please provide a sample of what your expected outcome would look like?

  9. #9
    Registered User
    Join Date
    11-18-2012
    Location
    Pville,LA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: auto fill rows based on number and formula

    sheet1 is the expected outcome, but i dont want to have to enter any information on this page manully no matter what the number entered on the land calc page is the rows would auto fill not sure how else to explain it

    Screenshot_1.png

  10. #10
    Registered User
    Join Date
    11-18-2012
    Location
    Pville,LA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: auto fill rows based on number and formula

    another way i guess i could explain it would be to on sheet1 is to take Row 1 and autofill in that column that many rows starting (number in cell A1:I1) at the 3rd Row with a certain formula

  11. #11
    Registered User
    Join Date
    11-18-2012
    Location
    Pville,LA
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: auto fill rows based on number and formula

    been playing around with VBA and figured out this little code for autofill

    Sub myautofill()
    Range("a4").Value = "=A3+400"
    Range("a4").Select
    Selection.AutoFill Destination:=Range("A4:A100")
    End Sub

    almost does what i want but little mod needed:

    i need this only to fill in the number of rows listed in A1 if A1=500 then i need A4-A503 filled in with out changing code everytime, so when A1 is changed autofills that many rows also need this to reset everytime anything in row 1 is changed
    Last edited by work4nutz; 11-06-2013 at 07:27 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto fill to last row (number of rows will vary) - SOLVED
    By artacus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2013, 11:03 AM
  2. Dynamic Auto-Fill Range based upon Specific number of rows
    By a333 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2013, 03:54 AM
  3. Auto Fill for unknown number of rows...
    By jlworden in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-10-2013, 12:41 PM
  4. Auto-Fill for user-specified number of rows
    By sirluki in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2012, 05:16 AM
  5. Auto fill color based on number
    By smithl1991 in forum Excel General
    Replies: 1
    Last Post: 03-11-2010, 05:07 PM

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