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

后端 未结 2 1566
暖寄归人
暖寄归人 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:36

    You can run this line to remove any #N/A error values in the worksheet:

    Cells.Replace "#N/A","",xlWhole
    

    If the worksheet contains formulas you can try this:

    Cells.SpecialCells(xlCellTypeFormulas,xlErrors).Clear
    

提交回复
热议问题