Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Needed to update rows in an excel document for a project called Time For Water, based on data @wasatnt released.
Sub FillRows()
For i = 1 To ThisWorkbook.Sheets.Count
Sheets(i).Activate
'You can add more code
With ActiveSheet
Dim lRow As Long
Dim lCol As Long
lRow = Cells(Rows.Count, 3).End(xlUp).Row
lCol = Cells(1, Columns.Count).End(xlToLeft).Column
For j = 2 To lRow
For k = 1 To lCol
With Cells(j, k)
If (.Value = "") Then
.Value = Cells(j - 1, k).Value
'Debug.Print .Value
'Debug.Print i & ": " & j & " - " & k & " > " & lRow
End If
End With
Next k
Next j
End With
Next i
Debug.Print "done, bro"
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment