Clear contents of cells in VBA using column reference

后端 未结 8 1911
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 22:31

I am trying to get a piece of code to clear the data in some cells, using the column references. I am using the following code:

Worksheets(sheetname).Range(.         


        
8条回答
  •  渐次进展
    2021-01-01 23:10

    For anyone like me who came across this and needs a solution that doesn't clear headers, here is the one liner that works for me:

    ActiveSheet.Range("A3:A" & Range("A3").End(xlDown).Row).ClearContents
    

    Starts on the third row - change to your liking.

提交回复
热议问题