Solved: Copy Worksheet Data

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jo15765

Thread Starter
Joined
Oct 11, 2011
Messages
307
I have a "Master" spreadsheet, and on that spreadsheet there are tab names that correspond with about 4 other worksheets. What I am wanting to do is copy the data from the worksheet, to the "Master" workbook's worksheet with the same worksheet name. I have this code:
Code:
Subscript out of range
Set wb = Workbooks.Open(Filename:="R:\Test\Master.xls")

Set wb = Workbooks.Open(Filename:="Z:\Test\Test1.xls")
Sheets("January").Rows("3:200").Copy
ActiveWorkbook("January.xls").Activate
Sheets("January").Select
Range("A3").Select
ActiveSheet.Paste
Range("A3").Select
Set wb = Workbooks.Open(Filename:="Test2.xls")
Sheets("Feb").Select
Rows("3:1000").Select
Selection.Copy
Windows("Feb.xls").Activate
Sheets("Feb").Select
Range("A3").Paste
Range("A3").Select
But I keep getting a subscript out of range debug error. Can someone shed some light onto what is causing that error and what modifications need to be made so that the error doesn't continue?
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,641
When and at which line of code do you get the problem?
Have you tried running the macro step-by-step?

Subscript out of range means that you're referring to something that is not there "out of range"

Since I don't have your files and sheets it can be anything.
 

jo15765

Thread Starter
Joined
Oct 11, 2011
Messages
307
Apalogies I got this code working. And you are correct Keebellah I typed my worksheet name wrong. Gotta remember to use copy/paste. However, thank you for the support!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top