Problem with Filters and Hidden Rows

Joined
Feb 9, 2009
Messages
1
Reaction score
0
I am trying to search for the max value in a filtered column. But for some reason it returns the max value for the entire column. Can anyone tell me what I am doing wrong? Thanks in advance

Code:
Columns("G:G").Select
Selection.AutoFilter Field:=3, Criteria1:=lastname
Range("G2:G2000" & lastRow).Select
Selection.SpecialCells(xlCellTypeVisible).Select
MsgBox Selection.SpecialCells(xlCellTypeVisible).Application.WorksheetFunction.Max(Range("G2:G2000"))
 

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

Top