pmcgrath92
New Member
- Joined
- Jul 24, 2014
- Messages
- 26
Hi all,
I'm new to the forum and new to VB, and was wondering if there was anyone out there who could lend a hand with a problem I'm having concerning pulling data from a closed workbook by using a macro. I have tried Google to resolve the issue, but am only getting very basic results which do not apply to the situation I have (or, rather, I perhaps don't know how to edit this code in order to work in the way which I would like it to). Apologies in advance if I come across as a complete noob, and any help/comments would be greatly appreciated!
The above image is the main workbook, which I would like to insert the macro into. In cell A1 you can see that there is a filename location - this is the location of the closed secondary workbook which I would like to pull the data from. I would like the macro to take the location which is present in cell A1, copy cells A1:J5000 in the closed workbook, and then paste these into this workbook starting in A7 (i.e. A7:J5007). The reason that the filename location is present in A1 is due to the fact that this will be changing; however I would like the macro always to take the location which is shown in A1 (e.g. if A1 were to change from '...\test00218_data.csv' to '...\test00001_data.csv' then I would like the macro to take the data from the new location, test00001). I'm not sure if this is possible to even do, and as mentioned above any help on the matter would be extremely appreciated.
Paul
I'm new to the forum and new to VB, and was wondering if there was anyone out there who could lend a hand with a problem I'm having concerning pulling data from a closed workbook by using a macro. I have tried Google to resolve the issue, but am only getting very basic results which do not apply to the situation I have (or, rather, I perhaps don't know how to edit this code in order to work in the way which I would like it to). Apologies in advance if I come across as a complete noob, and any help/comments would be greatly appreciated!

The above image is the main workbook, which I would like to insert the macro into. In cell A1 you can see that there is a filename location - this is the location of the closed secondary workbook which I would like to pull the data from. I would like the macro to take the location which is present in cell A1, copy cells A1:J5000 in the closed workbook, and then paste these into this workbook starting in A7 (i.e. A7:J5007). The reason that the filename location is present in A1 is due to the fact that this will be changing; however I would like the macro always to take the location which is shown in A1 (e.g. if A1 were to change from '...\test00218_data.csv' to '...\test00001_data.csv' then I would like the macro to take the data from the new location, test00001). I'm not sure if this is possible to even do, and as mentioned above any help on the matter would be extremely appreciated.
Paul