VBA Clear Table Format in Excel

VBA Clear Table Format

VBA Clear Table Format in Excel. Clearing or deleting or removing formatting from the table in Excel using VBA. Here we use the ListObjects collection and TableStyle property to delete or clear format. In this tutorial let us learn the example and step by step instructions to clear Format from the table.

Example to VBA Delete Table Formatting in Excel

Let us see the example to clear Format or styling from the table of data body range. The sheet name defined as ‘Table‘. And we use table name as ‘MyDynamicTable‘. You can change these two as per your requirement. Where TableStyle property is used to remove format from the table.

'VBA Clear Table Format
Sub VBAF1_Clear_Table_Format()
    
    'Declare Variables
    Dim sTableName As String
    Dim sSheetName As String
    
    'Define Variables
    sSheetName = "Table"
    sTableName = "MyDynamicTable"
    
    'Clear or Remove Table Format
     Sheets(sSheetName).ListObjects(sTableName).TableStyle = ""
    
End Sub

Output: Here is the following output screenshot of above example macro code.

VBA Clear Table Format in Excel

Instructions to Run VBA Macro Code or Procedure:

You can refer the following link for the step by step instructions.

Instructions to run VBA Macro Code

Other Useful Resources:

Click on the following links of the useful resources. These helps to learn and gain more knowledge.

VBA Tutorial VBA Functions List VBA Arrays in Excel VBA Tables and ListObjects

VBA Editor Keyboard Shortcut Keys List VBA Interview Questions & Answers Blog

Leave a Comment