Created
January 9, 2019 00:09
-
-
Save zbyna/8bfeb253205a386af6f91e2ad8b50d83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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