On 20 Oct, 00:34, JLGWhiz <JLGW...@discussions.microsoft.com> wrote:
> This worked on a small test area:
>
> Sub bckfl()
> Dim x, y As Range
> lr = Cells(Rows.Count, 1).End(xlUp).Row
> i = 2
> For Each y In Range("A2:A" & lr)
> lc = Cells(i, Columns.Count).End(xlToLeft).Column
> For Each x In Range(Cells(i, 1), Cells(i, lc))
> If x = "" And x.Offset(0, 1) = "" Then
> Range("A" & i, x.End(xlToRight).Offset(0, -1)) = x.End(xlToRight).Value
> ElseIf x = "" And x.Offset(0, 1) <> "" Then
> x.Offset(0, 0) = x.Offset(0, 1).Value
> End If
>
> Next x
> i = i + 1
> Next y
> End Sub
>
> Might need some tweaking for your application.
>
>
>
> "Jason Hall" wrote:
> > I am trying to figure out a way to backfill blank cells in Excel on the same
> > row. For example:
>
> > column A B C D
>
> > 1 x x x o
> > 2 x x o o
> > 3 x x x o
>
> > In row 1 I want the information in cell 1D populate the blank cells in
> > column 1A,1B, and 1C
> > In row 2 I want the information in cell 2C to poplulate the blank cells in
> > column 2A and 2B
>
> > Ideally, I want Excel to realize that there are blank cells in a row and
> > fill those blank cells with the first information it finds on that row.- Hide quoted text -
>
> - Show quoted text -
Hi,
How about
:
Sub FillRight()
With Range("A1

" & Cells(65536,1).end(xlup).row)
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=RC[1]"
.Formula = .Value
End With
End Sub
James