I have an Excel sheet on which I have created a list consisting of many values. Also I have created a macro which shows a userform in which those values are hard-coded.
Now I want that those values in the form to be automatically/programatically/dynamically added to my userform list, so that in the future, if I want to decrease the values from the list, then I would not have to change the macro again.
I have been searching for the answer but I have been unsuccessful in finding what I am looking for.
I have recorded this macro, but I don’t know how to retrieve values from it:
Sub Macro7()
'
' Macro7 Macro
'
'
Range("E1").Select
ActiveSheet.Range("$A$1:$AE$175").AutoFilter Field:=5
End Sub
The macro you’ve specified will turn on autofiltering for your active worksheet. This will provide column headers that will allow the user to filter to something of interest.
Assuming that this kind of filtering of the worksheet is what you want, you can use something like:
So when you do filtering, you can use SpecialCells(xlCellTypeVisible) to reveal the non-hidden cells, which are represented as have a range that wraps areas that represent contiguous ranges.