Macro to set a standard filter based on a double click.

Hello to all!

I am a newbie to LO and have absolutly zero knowledge in basic. Could anyone tell me if it’s possible to have the equivalent of this macro i used to make work on excel. I got sheet1 with collumn A and when i double click on a cell it searchs all matches in a table who is in a other sheet. Thanks in advance!

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If ActiveCell.Column = 1 Then
    Sheet2.ListObjects("Table2").Range.AutoFilter Field:=1, Criteria1:=ActiveCell.Value
    Sheet2.Activate
    End If
End Sub