Using offset following an autofilter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have used the autofilter on one column in my datasheet and i am trying to
select the cell to the right of the first cell in the filtered list.

The filter as it appears in code is:

Selection.AutoFilter field:=field, Criteria1:="<>"

I have very little knowledge of VBA and cannot get the offset function to
work on this one. Can you tell me what the next line of code should be to
select the offset cell?
 
For Each c In Selection
If Rows(c.Row).Hidden = False Then
If iCt = 0 Then
iCt = 1
Else
c.Offset(0, 1).Select
Exit For
End If
End If
Next c

Add this after what you have. Using iCt avoids the header row.

Hth,
Merjet
 
That worked a treat.

Cheers Merjet.

Do you know of any good online excel vba training?
 
Do a Google search for: excel vba tutorial online

You will find plenty. I can't say how good any of them are from
personal experience.

Hth,
Merjet
 

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