+ Reply to Thread
Results 1 to 7 of 7

Fill in between cells with non linear values

Hybrid View

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    91

    Fill in between cells with non linear values

    I'm using excel 2011 on a Mac Air running Yosemite
    I would like to have a column of numbers in no particular order with various blank cells in the column. Blanks may be 1 space or 5 spaces etc. I want to highlight the entire column and fill in all the missing numbers in between the numbers already in place (without changing those numbers). It is like using the FILL tool but highlight the entire column. On a windows computer running excel i used an addin called Kutools which did exactly that but i can't find Kutools for Mac. Not sure if it's a formula or VBA that i need. Any Help is Appreciated, Thanks,Jim

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Fill in between cells with non linear values

    Hi James,

    Which one of the Kutools did you use? See list at:
    http://www.extendoffice.com/product/...for-excel.html

    Then what did it fill those blank cells with?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    91

    Re: Fill in between cells with non linear values

    Kutools for excel it filled in the numbers in the blank cells making all numbers distribute evenly
    Here is a link to see exactly what I'm trying to explain. First it shows the standard Linear fill in excel, then shows the Linear fill in kutools for excel
    http://www.extendoffice.com/document...ar-values.html

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Fill in between cells with non linear values

    The only way I can imagine doing this is with VBA. Will you accept that kind of answer?

  5. #5
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    91

    Re: Fill in between cells with non linear values

    Absolutely. I have way too many numbers to do this manually. VBA is fine.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Fill in between cells with non linear values

    OK James,

    Here is the code and an example file. Give it a try.

    Sub FillBlanks()
        Dim Col As Double
        Dim StartRow As Double
        Dim EndRow As Double
        Dim SpanRows As Double
        Dim StartVal As Double
        Dim EndVal As Double
        Dim StepVal As Double
        
        Col = ActiveCell.Column
        
    Do Until ActiveCell.Row = Rows.Count
        Cells(1, Col).Select
        Cells(ActiveCell.Row, Col).End(xlDown).Select
        StartRow = ActiveCell.Row
        StartVal = ActiveCell.Value
        Cells(ActiveCell.Row, Col).End(xlDown).Select
        EndRow = ActiveCell.Row
        
        If EndRow = Rows.Count Then GoTo Done
        
            EndVal = ActiveCell.Value
            SpanRows = EndRow = StartRow
            StepVal = (EndVal - StartVal) / (EndRow - StartRow)
            If EndRow - StartRow > 1 Then
                Cells(StartRow + 1, Col).Select
                Do Until ActiveCell <> ""
                    ActiveCell.Value = Cells(ActiveCell.Row - 1, Col) + StepVal
                    Cells(ActiveCell.Row + 1, Col).Select
                Loop
            End If
    Loop
    Done:
    Cells(1, Col).Select
    End Sub

  7. #7
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    91

    Re: Fill in between cells with non linear values

    Thanks a lot MarvinP. You saved me a lot of time with that code. It works exactly like i needed it to. Thanks Again, Jim

+ 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. How to fill values between two specific cells?
    By media-tel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-16-2014, 11:55 PM
  2. Create a linear equation to fill in blank cells in a column
    By CEM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-10-2013, 12:24 PM
  3. [SOLVED] auto fill series linear growth trend between non-adjacent cells in a column
    By gshorey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2013, 04:34 PM
  4. Replies: 1
    Last Post: 04-11-2013, 01:02 PM
  5. Using Linear Regression to Fill in Missing Values
    By Matty's Dilemma in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-30-2009, 06:56 PM
  6. Fill blanks by linear interpolation
    By S_Horton in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2007, 08:33 AM
  7. [SOLVED] etsimate values of a linear trend for each pair of known values
    By Maarten in forum Excel General
    Replies: 2
    Last Post: 01-15-2006, 05:10 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