Hi all,
I'm a novice with VB, so go easy on me. I'm trying to write a macro to copy the same couple of cells from hundreds of excel files and paste them into one summary file. What I've written so far is:
Forgive the clumsy break down of the files; they range from 001 to 063, and since I don't know how to set x as a three digit number I decided to have a section for 1-9 and a second section (with the same code) for 10-63.![]()
Please Login or Register to view this content.
The problem I think I'm having is in referencing the workbook (the debugger always stops on the worksheets(wb).Activate line). Ideally I'd like the macro to open the files itself, but given that I can't even make it work when they're open I think I should start small. The issue, I believe, is that I'm not referencing the file correctly, since I'm trying to use the 'name + x' format to cycle through the files, and either I'm doing it wrong or this sort of variable referencing isn't suitable for the function. I've tried all manner of different tactics to get the activate workbook function liking my workbook name, but have had no luck.
Any help would be hugely appreciated, and once again, forgive my unsubtle coding.
Kate
Bookmarks