PDA

View Full Version : [SOLVED] Auto Fill Next Blank Cell in a Row with Value from the Row Above



arns
04-06-2018, 04:15 AM
Hi, I am trying to fix my Table which I have copied from a PivotTable.
I have been trying to fix the Tail and Id section of the table by using autofill.

The first rows in my table looks like this:
21981

I would like the end result to be like this (changes are highlighted in Italic):
21982

I've searched for an answer without any luck. Is there anybody who could help me to resolve this?

Best regards, Arns

mana
04-06-2018, 04:49 AM

mana
04-06-2018, 04:54 AM
Option Explicit


Sub test()
Dim r As Range

Set r = Range("a1").CurrentRegion.Resize(, 2)
r.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
r.Value = r.Value

End Sub



マナ

p45cal
04-06-2018, 03:14 PM
In the Design tab of the PivotTable Tools tab of the ribbon, you should find this:
21987