Sub AfillB()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("A2").AutoFill Range("A2:A" & LastRow)
Range("C2:D2").AutoFill Range("C2:D" & LastRow)
End Sub
It worked, but I'm having issues with column A. Since the value has a number in it, it doesn't keep the same value from cell A2. Is there any way to fix that issue?In your title you state "autofill" and in your question you state "copy". The below is for default autofill.
VBA Code:Sub AfillB() Dim LastRow As Long LastRow = Cells(Rows.Count, "B").End(xlUp).Row Range("A2").AutoFill Range("A2:A" & LastRow) Range("C2:D2").AutoFill Range("C2:D" & LastRow) End Sub
Try...Is there any way to fix that issue?
Sub FillValue()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "b").End(xlUp).Row
Range("A3:A" & LastRow).Value = Range("A2").Value
Range("C3:C" & LastRow).Value = Range("C2").Value
Range("D3:D" & LastRow).Value = Range("D2").Value
End Sub
This worked perfectly! Thank youTry...
VBA Code:Sub FillValue() Dim LastRow As Long LastRow = Cells(Rows.Count, "b").End(xlUp).Row Range("A3:A" & LastRow).Value = Range("A2").Value Range("C3:C" & LastRow).Value = Range("C2").Value Range("D3:D" & LastRow).Value = Range("D2").Value End Sub