小编Val*_*org的帖子

如果在该行中找不到字符","或Chr(44),则删除整行.重复所有行

我尝试写一些代码,将删除其中的人物""或CHR(44)不以任何该行中的细胞上发现的任何行.

我已经做到这一点,但我正在努力,因为代码只搜索C列","但我需要它来搜索整个当前行.

我该如何更新?

Sub DeleteRows()
' Defines variables
Dim Cell As Range, cRange As Range, LastRow As Long, x As Long


' Defines LastRow as the last row of data based on column C
LastRow = ActiveSheet.Cells(Rows.Count, "C").End(xlUp).row


' Sets check range as C1 to the last row of C
Set cRange = Range("C1:C" & LastRow)


' For each cell in the check range, working from the bottom upwards
For x = cRange.Cells.Count To 1 Step -1
    With cRange.Cells(x)
        ' …
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba excel-formula

1
推荐指数
1
解决办法
51
查看次数

标签 统计

excel ×1

excel-formula ×1

excel-vba ×1

vba ×1