How to remove #N/A that appears through out a worksheet? (VBA for excel Required)

后端 未结 2 1540
暖寄归人
暖寄归人 2021-01-03 11:09

I have to clear #N/A that happens through out my worksheet when ever i run my code. I\'m not sure why and have been debugging for a while but to no avail. What i could do to

2条回答
  •  走了就别回头了
    2021-01-03 11:53

    I don't know, but how about doing something like this instead? This is how I generally copy and paste, without problems.

    Sheets("pivot").Range("your range").Copy
    Worksheets("summary").Range("your range").PasteSpecial
    

    UPDATE If you still want to simply remove all the #N/As with your current code, you can use some code like this.

    If WorksheetFunction.IsNA(Cells(row, column)) Then Cells(row, column).ClearContents
    

提交回复
热议问题