IAintaBlonde.com

Now that u know, lets get serious…………..

Copy Previous row data into blank cells (in a selected column) : EXCEL

January15

Visited 255 times, 4 so far today

Sub Fill_Blanks()
Dim col As Long

Set wks = ActiveSheet
With wks
col = ActiveCell.Column
‘or
‘col = .range(“b1″).column

Set rng = .UsedRange ‘try to reset the lastcell
LastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set rng = Nothing
On Error Resume Next
Set rng = .Range(.Cells(2, col), .Cells(LastRow, col)) _
.Cells.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If rng Is Nothing Then
MsgBox “No blanks found”
Exit Sub
Else
rng.FormulaR1C1 = “=R[-1]C”
End If

‘replace formulas with values
With .Cells(1, col).EntireColumn
.Value = .Value
End With

End With

End Sub

posted under Uncategorized

Email will not be published

Website example

Your Comment:

 

Overall Top Posts

Top Posts for Today

  • Recent Comments:

    • admin: This driver was archived well before Windows 7 was released … I...
    • carrie: does this download work for windows 7?
    • Lilu: Thank you so much for the solution to the exercises.. !!! I REALLY...
    • admin: Ha Ha. Glad to have saved your life., I mean your time :P
    • Naomi: TY so much! you saved my life. Well, not my life, but you saved me...
    • David M: bohzo (hello) Very, very nice site!
    • ivenxoyz: Hi I saw your blog. You have done a good job, I really liked your...
  • Recent Trackbacks:

    • nihotaqicetuwacn: nihotaqicetuwacn...
    • blog: hello...
    • Recipes for all: Recipe for a great treat > Tandoori Chicken !!
    • Mahdi: Comment on Network Simulation Tools: The ultimate list
    • agrotime: Handling new Hardware on Windows / Reinstalling lost drivers