VBA 仅循环可见单元格

Sea*_*ley 0 excel vba

我正在使用下面的代码来遍历每一行,但是我只想遍历 B 列中的可见单元格(因为我已经过滤掉了我想忽略的值),范围从第 10 行 -194。有谁知道我会怎么做?

For X = 192 to 10 Step -1
    If Range("B" & X).Text = "" Then **This needs to change to visible cells only but not sure how!
        Code required insert here
    Else
    End If
Next X
Run Code Online (Sandbox Code Playgroud)

use*_*756 5

Dim cell as Range
With Range("B10:B192").SpecialCells(xlCellTypeVisible)
   For X = .Rows.Count to 1 Step -1
       Set cell = Range("A" & X) ' this sets the current cell in the loop
   Next X
End With
Run Code Online (Sandbox Code Playgroud)