Navigating through filtered cells

  • Thread starter Thread starter Reney Langlois
  • Start date Start date
R

Reney Langlois

Hi,
I'd like to step through rows of a column of cells
which are visible due to me setting a filter. I may want
to assign values to empty cells based on the values of
neighboring rows. Since the data is filtered, there may
be many "behind-the-scenes" rows that are not shown to
me. What are the VB navigation commands that I can use to
step my way through each row and reference only the
visible cells immediately above and below cells of
interest?

Thanks much,

Reney
 
Have a look
Sub Macro2()
Set Rg = Selection.CurrentRegion.SpecialCells(xlCellTypeVisible)
For Each Cell In Rg
If Intersect(Cell.Offset(1, 1), Rg) Is Nothing Then
''''Exit Sub
Else
Cell.Offset(1, 1).Select
End If
Next


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top