Hello everyone:
I'm currently working on what is suppose to be an easy macro program but for the life of me I can't figure out what's going wrong.
Okay here goes. Currently for the sake of simplicity I have two files involved in the macro. The overall purpose is just to copy certain cells from one to the other.
The current Excel file (also the one where the macro code is being written in) is called 'SampleExcelErrorFile.xls' and I want certain cells on the first sheet of this file, "Toronto" to be filled from another excel file, named "JanFebData_5AM_Issue.xls". Now, the cells being copied and pasted are not adjacent cells, and I must copy and paste cells from "JanFebData_5AM_Issue.xls" that are in rows with increments of 125 cells (e.g copy cell A1, then A125, A250, etc). And I want to paste these cells into column A of the file 'SampleExcelErrorFile.xls' that moves down 1 cell at a time (e.g B4, B5, B6, etc).
Below is part of the code that does this copying and pasting.
When I run the program, the following error pops up:
"Run-time error '-2147221080(800401a8)': Automation Error"
And other times when I run it, another error sometimes pop up saying something like "Runtime error 424, Object Required"
Given that I just started learning about macros a week ago, is there something wrong with my copy-and-paste function above using loop? Any help would be greatly appreciated!
Bookmarks