Consulting

Results 1 to 4 of 4

Thread: Auto Fill Next Blank Cell in a Row with Value from the Row Above

  1. #1
    VBAX Regular
    Joined
    Oct 2017
    Posts
    14
    Location

    Auto Fill Next Blank Cell in a Row with Value from the Row Above

    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:
    Before.JPG

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

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

    Best regards, Arns

  2. #2
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location

    Post


  3. #3
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
    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

    マナ

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    In the Design tab of the PivotTable Tools tab of the ribbon, you should find this:
    Capture3.JPG
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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