所以我有一个从列A到J(行可以不同)的数据范围。我需要我的宏做的是拿起行a中的单元格值为IGNORE或#N/A的任何位置,并清除整行内容。此后我有VBA删除所有空白行。我遇到的问题是,VBA不想提取“#N/A”值并清除内容 - 如果我将其忽略掉,它完全符合我想要的只有IGNORE。我的宏没有拿起值“#N/A”来清除内容
请有人协助 - 我认为这可能与N/A没有作为文本拾取有关。
谢谢。
Dim end_range As Double
Dim n As Double
'Set the range in which to search for Ignore
Sheets("Submit").Select
Range("A1").End(xlDown).Select
end_range = ActiveCell.Row
'Store the values of in a range
ReDim storeval(end_range)
For n = 1 To end_range
storeval(n) = Range(Cells(n, 1), Cells(n, 1)).Value
Range(Cells(n, 2), Cells(n, 2)).Value = storeval(n)
Next n
'Delete the entirerow if the value contains ignore or N/A
For n = 1 To end_range
If storeval(n) = "IGNORE" Or storeval(n) = "#N/A" Then
Range("A" & n).EntireRow.ClearContents
End If
Next n
Sheets("Submit").Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
你得到它的权利。 –
对不起,这个愚蠢的问题,但在我的代码中,我打电话给它? – ifeelcrazy123
'如果storeval(n)=“IGNORE”或IsNa(storeval(n))Then' –