Reputation: 1624
I am trying to use Autofill to Copy Cells down, It works fine for String type records, but numeric numers it is filling the series.
Before the code runs:
After the code runs:
I want it to fill down 0's.
Here is my code:
sh.Range("G" & lastR1, PreviousColumn & lastR1).AutoFill _
Destination:=sh.Range("G" & lastR1, PreviousColumn & lastR)
Upvotes: 0
Views: 274
Reputation: 1093
To fill down zeros, simply set the value to zero instead of using Autofill.
Use a single line of code, [a2:a5] = [a1].value
for example, to set a range of cells all to the same value.
Upvotes: 1
Reputation: 50008
Use value transfer:
With sh
.Range("G" & lastR1, PreviousColumn & lastR).Value = _
.Range("G" & lastR1, PreviousColumn & lastR1).Value
End With
Upvotes: 1