Workbook Question

CJMasta

New Member
Joined
May 24, 2010
Messages
36
Ok i have a program that goes to a different workbook and copies information. When i try to go back to the original workbook to paste the information, it says that it is out of range... can someone help me fix this? Code:
  • Application.Goto Workbooks(Page).Sheets(Page).Range(CurrentCell)
  • Goes here first
  • Copies information
  • Stops working here
  • Application.Goto Workbooks("ResultsMaster.xls").Sheets("Master.xls").Range(BeginAt)
 
Last edited:

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,392
Office Version
365
Platform
Windows
Are you sure you have the correct workbook/sheet/range names?

Does this work?
Code:
Workbooks(Page).Sheets(Page).Range(CurrentCell).Copy Workbooks("ResultsMaster").Sheets("Master").Range(BeginAt)
By the way I don't actually see any copying in your posted code.:)
 

CJMasta

New Member
Joined
May 24, 2010
Messages
36
I am copying specific information... the only thing i need to do is go back to the first page i left. the first goto goes to the page i am copying info from. The next goto goes to the page i am pasting things on.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,392
Office Version
365
Platform
Windows
You shouldn't need to goto any page to do that that sort of thing.

It's possible to copy without selecting/activating/gotoing/whatever.

Is what you posted all your code - there is no copying in it that I can see.:)
 

CJMasta

New Member
Joined
May 24, 2010
Messages
36
No i havent posted all my code. What i am trying to do is go into a huge sheet of information and copy values from certain cells. What my program does is it is copying data from a results page into a master. in the results page, there are several headings with the same name, the only difference is element and intensity. i want to copy one heading and the element to use to find where it goes in the master. The intensity is a value that is recorded depending on what element it is.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,392
Office Version
365
Platform
Windows
I kind of know what you want to do but I don't see why you think you need to go backwards and forwards between workbooks/sheets.

You should be able to write code that copys from avoids moving focus.

It's pretty hard to help though without seeing your actual code, if you have any that is.:)
 

Forum statistics

Threads
1,085,294
Messages
5,382,760
Members
401,804
Latest member
RB85

Some videos you may like

This Week's Hot Topics

Top