Macro : seeking max value after an Autofilter
There is no need to use the .Select method, in most cases
you can achieve your desired results by directly dealing
with the objects, so you can use the following
Dim dblAnswer As Double
Dim rngVisible As Range
Set rngVisible = Range("B:B").SpecialCells
(xlCellTypeVisible)
dblAnswer = Application.WorksheetFunction.Max(rngVisible)
HTH
TJ
-----Original Message-----
I can select using Range("B:B").SpecialCells
(xlCellTypeVisible).Select
1/ Is it correct to write Range("B:B") to specify I want
to select the column B ?
2/ How can I get the max of the selected data now ?
Thanks for your help.
Jerome.
----- tinyjack wrote: -----
You can use the SpecialCells method of the Range
object
and use the xlCellTypeVisible type.
HTH
TJ
.
|