I have a worksheet with some numerical data imported from a .txt file. Because some of this data is Null, I am getting a number of cells that contain "#NULL!". I need to convert these cells to 0 using VBA, but I'm not having much success. Could somebody tell me what is wrong with my code below.
Error.Type(1) should identify the #Null! error, according to the on-line help. However, whenever I run the code I get an error message 424 - "Object Required"
What am I doing wrong?
Thanks in advance
Lightning
Code:
Do While (Not IsEmpty(CurrentCell))
Set NextCell = CurrentCell.Offset(1, 0)
If CurrentCell = (Error.Type(1)) Then
CurrentCell.Value = 0
End If
Set CurrentCell = NextCell
Loop
Error.Type(1) should identify the #Null! error, according to the on-line help. However, whenever I run the code I get an error message 424 - "Object Required"
What am I doing wrong?
Thanks in advance
Lightning