Good Afternoon,
I try to optimize my master excel file by adding some macros. I looked over different forums, but I still don't understand why my code doesn't work.
I click on the commandbutton: CommandButton_Stage1.
First, it has to remove every filter.
Then, I want to filter the data at the cell "A4". (sheet Projects_List)
After, I want to use that filtered information (under the cell "C4") into a Listbox.
I want to expand the cell selection until it reaches a blank cell.
Here's my code:
Private Sub CommandButton_Stage1_Click()
Sheets("Projects_List").Select
ActiveSheet.AutoFilterMode = False
ActiveSheet.Range("$A$4:$J$20").AutoFilter Field:=1, Criteria1:="1"
Set rRange = Range("C4", Range("C4").End(xlDown)).Cells.SpecialCells(xlCellTypeVisible)
ListBox_Projects.RowSource = rRange.Address
End Sub
Thanks for your help,
Its appreciated.
I try to optimize my master excel file by adding some macros. I looked over different forums, but I still don't understand why my code doesn't work.
I click on the commandbutton: CommandButton_Stage1.
First, it has to remove every filter.
Then, I want to filter the data at the cell "A4". (sheet Projects_List)
After, I want to use that filtered information (under the cell "C4") into a Listbox.
I want to expand the cell selection until it reaches a blank cell.
Here's my code:
Private Sub CommandButton_Stage1_Click()
Sheets("Projects_List").Select
ActiveSheet.AutoFilterMode = False
ActiveSheet.Range("$A$4:$J$20").AutoFilter Field:=1, Criteria1:="1"
Set rRange = Range("C4", Range("C4").End(xlDown)).Cells.SpecialCells(xlCellTypeVisible)
ListBox_Projects.RowSource = rRange.Address
End Sub
Thanks for your help,
Its appreciated.