• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to copy fixed values into the blank cells?

idnoidno

New Member
upload_2017-4-18_1-42-35.png

I would like to use the EXCEL VBA array to handle the left form into the right table. If someone can answer,I will be very grateful.
 
No sorry and no problem. Just in case you cross-post, you have to put all the links to the other threads.
Regards
 
Hi:

Use the following code.

Code:
Sub test()
Application.ScreenUpdating = False
Dim rng As Range

For i& = 2 To Me.Cells(1, Columns.Count).End(xlToLeft).Column
    Set rng = Me.Range(Me.Cells(2, i), Me.Cells(Me.Cells(Rows.Count, 1).End(xlUp).Row, i))
    rng.SpecialCells(xlCellTypeBlanks) = Cells(1, i)
Next

Application.ScreenUpdating = True
End Sub

Thanks
 

Attachments

  • Book1.xlsm
    15.2 KB · Views: 0
Try
Code:
Sub test()
    With Range("a1").CurrentRegion  '★ alter to suite.
        With .Offset(1, 1).Resize(.Rows.Count - 1, .Columns.Count - 1)
            On Error Resume Next
            .SpecialCells(4).Formula = "=r" & .Row - 1 & "c"
            On Error GoTo 0
            .Value = .Value
        End With
    End With
End Sub
 
Back
Top