Hello everyone, sorry if this is in the wrong section please tell me if so.
Right, what I am trying to do is create a button where when I click on it it will automatically filter the data accordingly.
I have managed to get the each section of the if statement to work independently from one another. But it just does not seem to work combined.
Please find code attached code that works on it's own is highlighted in red thanks
If regionselect = "All" Then
Sheets("Raw Data").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=11
Selection.AutoFilter Field:=17
Sheets("Sheet1").Select
Else
Sheets("Raw Data").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=11
Selection.AutoFilter Field:=17, Criteria1:=Range("Regionselect")
Sheets("Sheet1").SelectEnd If
Thanks in advance..
Richard
Right, what I am trying to do is create a button where when I click on it it will automatically filter the data accordingly.
I have managed to get the each section of the if statement to work independently from one another. But it just does not seem to work combined.
Please find code attached code that works on it's own is highlighted in red thanks
If regionselect = "All" Then
Sheets("Raw Data").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=11
Selection.AutoFilter Field:=17
Sheets("Sheet1").Select
Else
Sheets("Raw Data").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=11
Selection.AutoFilter Field:=17, Criteria1:=Range("Regionselect")
Sheets("Sheet1").SelectEnd If
Thanks in advance..
Richard