Results 1 to 3 of 3

Thread: Automatically inputting missing numbers in a specific range

  1. #1

    Automatically inputting missing numbers in a specific range



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I'm looking for a way to automatically input missing numbers between some other numbers I manually imputed. I already search a loot about it, but I couldn't find any solution.


    img24.otofotki.pl/obrazki/jn316_Excel1.jpg


    I'm looking for a way to automatically fill out the missing data in column A. As you can see, I know some numbers and a loot of cells are empty. Filled out numbers must to be based on the already existing numbers.


    After using formula/VBA I hope to achieve something like this:


    img24.otofotki.pl/obrazki/ru980_Excel2.jpg


    Numbers in red are imputed automatically.


    Does any one have any idea how I can do that?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	jn316_Excel1.jpg 
Views:	16 
Size:	12.9 KB 
ID:	3388   Click image for larger version. 

Name:	ru980_Excel2.jpg 
Views:	16 
Size:	16.4 KB 
ID:	3389  

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,512
    Articles
    0
    Excel Version
    365
    using this macro, first select a single column of cells which includes a value in the top cell and a value in the bottom cell (the blank cells must truly be blank/empty and no formula in them either), then run:
    Code:
    Sub blah()
    For Each are In Selection.SpecialCells(xlCellTypeBlanks).Areas
      are.Offset(-1).Resize(are.Rows.Count + 2).DataSeries Rowcol:=xlColumns, Type:=xlGrowth, Trend:=True
      'the next three lines could round the values that have just been put in; take out the 3 leading apostrophes to make them work.
    '  For Each cll In are.Cells
    '    cll.Value = Round(cll.Value, 0)
    '  Next cll
    Next are
    End Sub
    One more thing, I'm not sure what logic you use to interpolate the values you want, I've used a Growth interpolation above (it ends up with values closer to your values, especially between 10 and 27); if you want it to be a linear interpolation instead, change xlGrowth to xlLinear.

    post posting comment:
    Omnibon33, I see you have cross posted in multiple locations, this has the potential to really exasperate those who try to help you - please have a serious read of http://www.excelguru.ca/content.php?184 to see why - ultimately it will be to your benefit.
    Last edited by p45cal; 2015-04-18 at 04:53 PM.

  3. #3

Tags for this Thread

Posting Permissions

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