to adjust download

  • Thread starter Thread starter officegirl
  • Start date Start date
O

officegirl

I am downloading huge reports from unix and after the original 7 lines of
heading I need to delete the repeating page headings (always 7 lines)the data
is 49 lines
so I need the first 7 lines of heading than 49 lines of data, than delete 7
lines of heading , than I need 49 lines of data and this should repeat until
the end of the worksheet that is sometimes ~30000 lines
 
Hi

This macro should to it:

Sub RemoveHeadings()

LastRow = Range("A" & Rows.Count).End(xlUp).Row
HeaderBlock = 7
DataBlock = 49
TargetRow = HeaderBlock + DataBlock

Rows(TargetRow + 1).Resize(7).Delete

Do
TargetRow = TargetRow + DataBlock
Rows(TargetRow + 1).Resize(7).Delete
LastRow = LastRow - 7
Loop Until TargetRow > LastRow
End Sub

Regards,
Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top