Results 1 to 5 of 5

Thread: data filling

  1. #1
    Lounger
    Join Date
    May 2008
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    data filling

    The scenario: A column with numbers (non adjacent) and blanks. The number of blanks (randomly distributed), can range from 0 to 20.
    The task: To replace the numbers with a fill down linearly increasing series.
    I tried to put a filter for selecting "non Blanks", and a formula adding one to the value above; but doesn't work w/ the row spacing >1.
    Searched for a Worksheet function but couldn't find any.
    Any help w/ function will be OK.
    Thanks a lot in advance.
    Daniel Rozenberg

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: data filling

    This can be fairly easily done with VBA code:

    <pre>Public Sub FillCells()
    Dim oCCell As Range
    Dim lNVal As Long
    lNVal = ActiveCell.Value
    For Each oCCell In Selection
    If (oCCell.Value <> "" And IsNumeric(oCCell.Value)) Then
    oCCell.Value = lNVal
    lNVal = lNVal + 1
    End If
    Next oCCell
    End Sub
    </pre>


    Type the starting value in the first cell in the range, then select all of the cells to be checked and run that subroutine.
    Legare Coleman

  3. #3
    Lounger
    Join Date
    May 2008
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: data filling

    Thanks a lot.
    I'll try it and let you know.

    Daniel.

  4. #4
    Lounger
    Join Date
    May 2008
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: data filling

    IT DID WORK!!!
    Beautifully!
    Thanks a million + 1

    Daniel Rozenberg.

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: data filling

    Glad I Could help.
    Legare Coleman

Posting Permissions

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