Results 1 to 4 of 4

Thread: Fill Blanks With Averages

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member p45cal's Avatar
    Join Date
    Oct 2013
    Posts
    94
    Rep Power
    13
    See if this does anything for you:
    Code:
    Sub blah()
    lr = Cells(Rows.Count, "A").End(xlUp).Row
    Range("B1:B" & lr).Value = Range("A1:A" & lr).Value
    For Each are In Range("B1:B" & lr).SpecialCells(xlCellTypeBlanks).Areas
      With are.Offset(-1).Resize(are.Rows.Count + 2)
        .DataSeries Rowcol:=xlColumns, Type:=xlLinear, Trend:=True
      End With
      For Each cll In are.Cells
        cll.Value = Round(cll.Value)
      Next cll
    Next are
    End Sub

  2. #2
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Rep Power
    0

    Perfect

    Hi P45cal

    That worked perfectly, I really appreciate your helping.

    It looks very elegant and introduces several new bits of Excel which I will attempt to understand.

    Many thanks,

    Nick

Similar Threads

  1. Replies: 9
    Last Post: 02-11-2014, 07:42 AM
  2. fill in cells according to selected optionbutton
    By paul_pearson in forum Excel Help
    Replies: 6
    Last Post: 09-13-2013, 10:26 AM
  3. Macro to clear data based on color fill
    By Howardc in forum Excel Help
    Replies: 7
    Last Post: 12-03-2012, 09:25 AM
  4. Unmerge Cells and Fill with Duplicate Values
    By princ_wns in forum Excel Help
    Replies: 3
    Last Post: 10-09-2012, 07:36 AM
  5. Replies: 4
    Last Post: 07-27-2012, 08:43 AM

Posting Permissions

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