Hello,
I have spotty data in cells in Columns A-D. I want to fill all the empty cells in Columns A-D with the data that would be above the missing cells filling down, until you get the next data and then fill down for those.
I have code that will do it but I need to change the range to from end up.
Column E is fully filled out and that should be what is determined the end range.
Thank you in advance!
I have spotty data in cells in Columns A-D. I want to fill all the empty cells in Columns A-D with the data that would be above the missing cells filling down, until you get the next data and then fill down for those.
I have code that will do it but I need to change the range to from end up.
Column E is fully filled out and that should be what is determined the end range.
Thank you in advance!
VBA Code:
Sub Fill()
Set Worksheet = Worksheets("Report")
Set Dataset = Worksheet.Range("A2:D50") ' This is where I need to change the range. Number of rows can be determined from end up of column E
For i = 1 To Dataset.Columns.Count
For j = 1 To Dataset.Rows.Count
If Dataset.Cells(j, i) = "" Then
Dataset.Cells(j, i) = Dataset.Cells(j - 1, i)
End If
Next j
Next i
End Sub