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

ios - Memory not freeing up after popping viewcontroller using ARC -

Java JSoup error fetching URL -

webstorm - PhpStorm file cache conflict with TypeScript compiler -