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 -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -