I use this code in an attempt to clean potential N/A values in one of the columns.
Sub FixData()
Dim r As Range
Range("AL7").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
For Each r In Selection
If r.Text = "#N/A" Then
r.Value = r.Offset(-1, 0).Value
End If
Next
End Sub
The data that I want to clean is in the area AL7:AS191. The area is marked, but it doesn't seem like the loop is running. The N/A values are still there.
I have tried to do as the answer by Gary's Student suggest here: Changing #N/A values in Excel to last non-error value in the spreadsheet
Does it need minor adjustments?
All the best, Christoffer