• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to clear the cells only from the table

S P P

Member
Good Morning!

How to clear the cells only from the table as in the example
 

Attachments

  • SPP How to clear the cells only from the table.xlsm
    20.5 KB · Views: 11
Do you mean this?
Code:
Sub CleanCells()
With Sheets("Plan1").ListObjects("Tabela1")
    If Not .DataBodyRange Is Nothing Then .DataBodyRange.ClearContents
End With
End Sub
 
Hi,
Like this?
Code:
Sub CleanCells()
For i = 3 To 17
    Sheets("Plan1").ListObjects("Tabela1").ListColumns(i).DataBodyRange.ClearContents
Next i
For i = 24 To 28
    Sheets("Plan1").ListObjects("Tabela1").ListColumns(i).DataBodyRange.ClearContents
Next i
End Sub
 
Back
Top