how select block w/unknown last col and last row?

  • Thread starter Nikos Yannacopoulos
  • Start date
N

Nikos Yannacopoulos

Ian,

Try this:
In the copied from sheet, without inserting blank lines:
Range("A1").select
Range(Selection, Selection.end(xlToRight)).Select
Range(Selection, Selection.end(xlDown)).Select
Selection.Copy

In the copied to sheet:
Range("A4").Select
Selection.PasteSpecial....

This way you will only copy the populated range.
Important: no gaps in row 1 and Column A!

If you have gaps in row 1 but not in column A, you could
alternatively copy entire rows:
Rows("1").Select
Range(Selection, Selection.end(xlDown)).Select
Selection.Copy

Caution: If it may be that the range you are pasting is
narrower / shorter than the previous one, you will need to
clear the old data first. You can do so by selecting in
the same manner and deleting / clearing contents.

Nikos
 

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

Similar Threads


Top