Clear column contents

How can I clear the contents of a column from cell A3 to cell __, where __ represents the last record in the column (assuming there are no empty spaces between the records).

Thanks for the help.

+5
source share
4 answers
range("A3", columns("A").SpecialCells(xlCellTypeLastCell)).Delete

This will delete A3 through the last cell in column A, regardless of the spaces in the column.

range("A3", range("A3").End(xlDown)).Delete

This will remove from A3 to the first empty cell after A3 in column A.

+9
source
Range("A3", Range("A3").End(xlDown)).Clear

Using .Delete will actually delete cells by moving all the cells that may appear after this list (separated by an empty cell). If you just want to clear the contents,. Clear is a good way.

+8
source

vbNullString, .

"" A3 A:

Range(Cells(1,3), Cells(Range("A3").End(xlDown).Row,1)).Value = vbNullString

"" A3 A:

Range(Cells(1,3), Cells(Range("A3").SpecialCells(xlTypeLastCell),1)).Value = vbNullString
+1
source

I had good results with this:

Set tbl = ActiveSheet.ListObjects("Table_Name")
Count = tbl.DataBodyRange.Rows.Count

Range("AC2:AC" + CStr(Count)).Select
Selection.ClearContents
0
source

All Articles