Hi guys,
I have ~180 rows of data (~2500 cells) that normally are fine.
Occasionally when I get the data (date/price from yahoo) using another macro, a row may be blank or contain null which throws off later working macros.
I have a working macro to get rid of that issue, but it takes a LONG time to run since it is going cell/row by row.
Is there a faster way? I have tried to put the data into a temporary array, but struggle once it is there to find out how to replace a blank/null row with previous so I go back to the Long way.
I have ~180 rows of data (~2500 cells) that normally are fine.
Occasionally when I get the data (date/price from yahoo) using another macro, a row may be blank or contain null which throws off later working macros.
I have a working macro to get rid of that issue, but it takes a LONG time to run since it is going cell/row by row.
Is there a faster way? I have tried to put the data into a temporary array, but struggle once it is there to find out how to replace a blank/null row with previous so I go back to the Long way.
VBA Code:
Sub FillCellFromAbove()
Application.ScreenUpdating = False
Dim answer As Integer
answer = MsgBox("ONLY FIX NULLS OR BLANKS IF THE PROBLEMS CELL SHOWS A VALUE", vbInformation + vbOKCancel, "Fix Nulls or Not")
Select Case answer
Case vbOK
Sheets("Adjusted Close Price").Select
Range("B2:AY181").Select
For Each Row In Selection
If Row.Value = "" Or Row.Value = "null" Then
Row.Value = Row.Offset(-1, 0).Value
End If
Next Row
Case vbCancel
End Select
Application.ScreenUpdating = True
End Sub