下移到vba excel中过滤数据的下一行
我的床单是这样的: 我想做的就是,我可以向下移动下一行,显示它的值。 我已经有了密码:下移到vba excel中过滤数据的下一行,excel,vba,Excel,Vba,我的床单是这样的: 我想做的就是,我可以向下移动下一行,显示它的值。 我已经有了密码: Sub test() 'Select the first row. MsgBox Sheet1.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 3).Value 'Then move down to the second row of filtered data. 'Code End Sub 有人能建议我如何
Sub test()
'Select the first row.
MsgBox Sheet1.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 3).Value
'Then move down to the second row of filtered data.
'Code
End Sub
有人能建议我如何完成上面的任务吗
非常感谢您的帮助。您可以尝试实施/调整以下内容:
您可以尝试实施/调整以下内容:
非常感谢。然而,我想知道:循环总是从上到下的,不是吗?是的,这种特殊的循环方式确实非常感谢你。我真的很感谢你的帮助。呵呵,谢谢你。然而,我想知道:循环总是从上到下的,不是吗?是的,这种特殊的循环方式确实非常感谢你。我真的很感谢你的帮助。呵呵。
Sub VisRows()
Dim rng As Range, lr As Long
With Sheet1 'Change accordingly
lr = .Cells(.Rows.Count, "B").End(xlUp).Row
Set rng = .Range("B2:B" & lr)
'Apply your filter
For Each cl In rng.SpecialCells(xlCellTypeVisible)
Debug.Print cl.Value
Next cl
End With
End Sub