Jak
Well-known Member
- Joined
- Apr 5, 2002
- Messages
- 833
Trying to fill down a value that appears in cell A2. The following code errors at the line:
Set FillRange = Range(Cells(x, y), Cells(r - 1, y))
Tried to debug it but to no avail. Any suggestions with the code welcomed.
Dim FillRange As Range
Dim FillWith As Range
Dim x As Long
Dim y As Long
Dim r As Long
Dim EndRow As Long
EndRow = Cells.SpecialCells(xlCellTypeLastCell).Row
x = 2 'Start at row 2
y = 1 'Column equals A
Do Until x > EndRow
r = Cells.SpecialCells(xlCellTypeBlanks).Row
Set FillRange = Range(Cells(x, y), Cells(r - 1, y))Set FillWith = Cells(x, y)
FillWith.AutoFill FillRange
x = r + 1
Loop
Set FillRange = Range(Cells(x, y), Cells(r - 1, y))
Tried to debug it but to no avail. Any suggestions with the code welcomed.
Dim FillRange As Range
Dim FillWith As Range
Dim x As Long
Dim y As Long
Dim r As Long
Dim EndRow As Long
EndRow = Cells.SpecialCells(xlCellTypeLastCell).Row
x = 2 'Start at row 2
y = 1 'Column equals A
Do Until x > EndRow
r = Cells.SpecialCells(xlCellTypeBlanks).Row
Set FillRange = Range(Cells(x, y), Cells(r - 1, y))Set FillWith = Cells(x, y)
FillWith.AutoFill FillRange
x = r + 1
Loop