excel - Delete all data but one column in VBA -


sorry basic question.

i trying delete data worksheet, want keep data in column a. have worked out how clear rows whilst keeping header can't find way save data in column a.

does know how this?

    worksheets("data")      .rows("2:" & .usedrange.count).delete     end 

the .usedrange.count return count of cells in used range, not rows.

if understand correctly, want delete b2 end of used range. can this:

with worksheets("data")     .range("b2", cells(.usedrange.rows.count, .usedrange.columns.count)).clearcontents end 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -