Carlos Arronte Bello
Carlos Arronte Bello

Reputation: 429

Clear Contents in specific rows vba

I'm working on excel with VBA. I have a code that applies some filters and some formulas. That part works. The problem is in the print part.

I need to print 10 lines (only one example could be more or less), but I have 15 (again just an example) lines of previous operations. So I need to overwrite the first 10 lines, that I do well, and then delete all the rest of the lines that in this case are only 5 (but could be 15, 30 or more). I also just need to delete the information between a specific range of columns as an example of deleting from A: AL. I'm using this:

Worksheets("Extract").Columns("A:AL").ClearContents

Upvotes: 0

Views: 3490

Answers (1)

Egan Wolf
Egan Wolf

Reputation: 3573

You said nothing about the way how you can calculate rows to delete, so that's all I have for you. You must fill this with first and last rows to delete.

Worksheets("Extract").Range("A" & (insert first row to delete here) & ":AL" & (insert last row to delete here)).ClearContents

Upvotes: 1

Related Questions