One may need several types of filters in an Excel sheet to help with VBA programming. An Excel sheet is used to simplify tedious calculations and setting filters are important in the process. This will help in setting a range in Excel by using simple programs in VBA. The main query people have is how to retrieve objects in an object range format. The article below is a small VBA programming lesson on selecting an auto filter and object range in the field of a particular cell in an Excel sheet. Initiate it by starting a macro and end the sub VBA program. The cells must be active and not hidden by filters.
[VBA-EXCEL] - AutoFilter and Object Range Method
With VBA programming, it is possible to set filters on a sheet:
This should answer your problem:
Sub Macro2 ()
Sun rngSelect As Range
'I assumed that the filters are on line 1
Range ( "A1"). Select
'Selection.AutoFilter Field: = 1, Criteria1: = "FOO"
Selection.AutoFilter Field: = 7 Criteria1: = "* paris *"
'RngSelect = all cells visible (not hidden by the filter)
'Contiguous to the active cell
Set rngSelect = ActiveCell.CurrentRegion.SpecialCells (xlCellTypeVisible)
'Copy the selected area
'Many and varied
Set rngSelect = Nothing
In the same category
Published by aakai1056
- Latest update by Virginia Parsons