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:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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.:)
 
Upvote 0
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.
 
Upvote 0
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.:)
 
Upvote 0
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.
 
Upvote 0
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.:)
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top