Hi,
I've already had a look through some of the old threads along the same lines, unfortunately none of the ones that I found could help.
What I'm wanting to do is copy several ranges of data (I'll probably have to do each seperately) from a protected form on a spreadsheet, and put these ranges into a spreadsheet in a different workbook. This would probably work fine using the normal copy and paste methods, but the form that the data is being copied from is selected by the user and is not in a predefined list!
I have tried the following code:
Workbooks(FileToOpen).Worksheets("Coiled Tubing"
.Range("B8:B14"
.Copy Workbooks("Excel Database"
.Worksheets("Coiled Tubing"
.ActiveRange("A:G"
.PasteSpecial(xlPasteValues)
where FileToOpen is the file opened by the user.The following error occurs when I get to the copying part of my coding:
Run-time error '9':
Subscript out of range
Can anybody help me sort this problem out? If you'd like the whole of the coding just let me know!
Thanks in advance
Jane
[PC2]
I've already had a look through some of the old threads along the same lines, unfortunately none of the ones that I found could help.
What I'm wanting to do is copy several ranges of data (I'll probably have to do each seperately) from a protected form on a spreadsheet, and put these ranges into a spreadsheet in a different workbook. This would probably work fine using the normal copy and paste methods, but the form that the data is being copied from is selected by the user and is not in a predefined list!
I have tried the following code:
Workbooks(FileToOpen).Worksheets("Coiled Tubing"
where FileToOpen is the file opened by the user.The following error occurs when I get to the copying part of my coding:
Run-time error '9':
Subscript out of range
Can anybody help me sort this problem out? If you'd like the whole of the coding just let me know!
Thanks in advance
Jane
[PC2]