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
Post a Comment