I'm trying to fill down various columns based on the cell value above it, and have found various examples in how do so including the below macro.
But what I'm finding is that this does not always work. I have found that for cells that are formatted as Text, the macro returns the =R[-1]C instead the correct cell value.
Sub XFillInBlanks()
Dim Rng1 As Range, Rng2 As Range
Set Rng1 = Selection
On Error Resume Next
Set Rng2 = Rng1.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not Rng2 Is Nothing Then
Rng2.FormulaR1C1 = "=R[-1]C"
With Rng1
.Value = .Value
End With
End If
End Sub
Is there a way to fill blank cells without having to first change the formatting back to General?
Bookmarks