Hi,

I've been trying to develop a code that does the following, but I've been having a lot of trouble. I recorded a macro but I guess there must be an easier way to do it.

Here's what I need to do and what I've done.

I have several files stored in a folder. Everytime I run my macro, which is a file that I also have in the current folder, each file must do the following:

1. Open file. (Already done in current macro)
2. Unprotect file. (Already done in current macro)
3. Copy certain information located in a different file from the macro. (Already donde it manually but I need something easier instead of large repetitions)
4. Paste the information in the macro worksheet. (Already done, but as I said, something easier (shorter code) will work better)
5. Protect file. (Already done in current macro)
6. Close file. (Already done in current macro)

Now, here's the complicated thing for me. Each time I open a file (worksheet 2 in workbook 2), different from the macro file (worksheet 1 in workbook 1), I copy and paste the information in the next order:

Please Login or Register  to view this content.
Now, the complicated part comes next. The next thing I should do is copy the same data in worksheet 2 in workbook 2 but located 58 cells below the cell I already selected. So, if I copied "C2" last time, now I must copy "C60". If a copied a range "K47:AN49", now I must copy the range "K105:AN107". And so on, until there's no data left.

Once I have that, I need to paste the information I copied in worksheet 1 in workbook 1. There's a new condition here. If the last past command pasted information between the range "B2:B29", now I have to paste the new information below that range. That is, paste the information in range "B30:B57". So it is pasted lines after the command that precedes this instruction. If last time I pasted the information in "F2", now I need to past it in "F30". And so on.

I've already done it manually, but the code seems to be really long and it takes a long time to be completed. I would be glad to recieve any suggestions.

Thanks you for your help.