Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sub Sheet2_Button1_Click()
'
' Sheet2_Button1_Click Macro
'
Dim Tabulka As ListObject
Dim List As Worksheet
Set List = ActiveSheet ' to get code completion, it does not work on ActiveSheet property
Set Tabulka = List.ListObjects.Add(SourceType:=xlSrcRange, _
Source:=Range("c3:h14"), _
XlListObjectHasHeaders:=xlYes)
Tabulka.DisplayName = "Tabulka"
Set Tabulka = Nothing
Set List = Nothing
End Sub
Sub Button2_Click()
'
' Button2_Click Macro
'
Dim Tabulka As ListObject
Dim List As Worksheet
Set List = ActiveSheet ' to get code completion, it does not work on ActiveSheet property
Set Tabulka = List.ListObjects("Tabulka")
Tabulka.Unlist
Set Tabulka = Nothing
Set List = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.