Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Access the values from combo box after autofiltering
I would like to access from VBA code the values from combo box afte
autofiltering. Ex: (All), (Top10...), (Custom...), 1, 2, 3, 4... -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Access the values from combo box after autofiltering
Public Function ShowFilter(rng As Range)
Dim filt As Filter Dim sCrit1 As String Dim sCrit2 As String Dim sop As String Dim lngOp As Long Dim lngOff As Long Dim frng As Range Dim sh As Worksheet Set sh = rng.Parent If sh.FilterMode = False Then ShowFilter = "No Active Filter" Exit Function End If Set frng = sh.AutoFilter.Range If Intersect(rng.EntireColumn, frng) Is Nothing Then ShowFilter = CVErr(xlErrRef) Else lngOff = rng.Column - frng.Columns(1).Column + 1 If Not sh.AutoFilter.Filters(lngOff).On Then ShowFilter = "No Conditions" Else Set filt = sh.AutoFilter.Filters(lngOff) On Error Resume Next sCrit1 = filt.Criteria1 sCrit2 = filt.Criteria2 lngOp = filt.Operator If lngOp = xlAnd Then sop = " And " ElseIf lngOp = xlOr Then sop = " or " Else sop = "" End If ShowFilter = sCrit1 & sop & sCrit2 End If End If End Function demonstrates one approach. =filter(b9) would show the filter criteria for column B -- Regards, Tom Ogilvy "stefantem " wrote in message ... I would like to access from VBA code the values from combo box after autofiltering. Ex: (All), (Top10...), (Custom...), 1, 2, 3, 4.... --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populating a list/combo box with an Access column. | Excel Discussion (Misc queries) | |||
combo box and access | New Users to Excel | |||
Combo Box Values from Access Table? | Excel Discussion (Misc queries) | |||
registering the cell values of excel combo box associated values | Excel Programming | |||
Populating a lis/combo box in excel with access data | Excel Programming |