Delete #N/A

Closed
Andy - May 16, 2011 at 09:32 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - May 17, 2011 at 02:01 AM
Hello,

I used the following code to copy rows from one workbook to another

Do Until IsEmpty(i.Range("Q" & j))

If i.Range("Q" & j) = "TERM" Then
d = d + 1
e.Rows(d).Value = i.Rows(j).Value

But after copying its putting #N/A on the remaining columns. Please let me know how to remove the columns having #N/A or how to avoid macro putting #NA.

Thanks a ton!

Andy

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
May 17, 2011 at 02:01 AM
try this (not checked)

Do Until IsEmpty(i.Range("Q" & j))

If i.Range("Q" & j) = "TERM" Then
d = d + 1
e.Rows(d).Value = i.Rows(j).Value
Else
e.Rows(d).Value ""
End If
0