kabushnell
Technical User
I am working on a macro and almost finished except I can't make one part work. I want to copy the value in cell B1 and copy to all rows in column B. I am trying to have it paste but the problem is the number of rows changes. I have used a code similar to the one below before with sucess but I can't seem to get this to work. Any thoughts?
Lastrow = ActiveSheet.Cell(1,1).CurrentRegion.Rows.Count+1
Range("B1").Select
Selection.Copy
With Range(Cells(Lastrow, "B"))
.PasteSpecial Paste:=xlPasteValues, Operation:=x1None, _
SkipBlanks:=False, transpose:=False
.AutoFill _
Destination:=Range("B1" & Lastrow), Type:=x1FillDefault
.Select
Selection.Clear
End With
Lastrow = ActiveSheet.Cell(1,1).CurrentRegion.Rows.Count+1
Range("B1").Select
Selection.Copy
With Range(Cells(Lastrow, "B"))
.PasteSpecial Paste:=xlPasteValues, Operation:=x1None, _
SkipBlanks:=False, transpose:=False
.AutoFill _
Destination:=Range("B1" & Lastrow), Type:=x1FillDefault
.Select
Selection.Clear
End With