Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference of Range in another file with VB
Hi all:
A new problem comes to me, maybe some of you have already experience on it. Because of the file size (18 MB), I split this excel file (containing VB code) in two files A and B. Now is the problem: 1. The Config sheet of file A contains some data which will be used by two files. In this sheet are several Ranges defined. These range are used by other sheets which are now in both files and in VB code. Question: 1. How can I make a reference to a range in file Afrom VB code in file B? I have tried to use like for each a in [A]Config!ref_range or: for each a in ["A"]Config!ref_range Neither woks. 2. I opened the linked excel file A with VB program. Is it unnessary because there are already links between sheets? Will two instance of the excel file A be opened? If I don't do it in VB, the VB code doesn't run. Is there a better way to do it? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference of Range in another file with VB
dim c as range
for each c in workbooks("A.xls").range("ref_range").cells 'do stuff next c Tim "Steven P" wrote in message ups.com... Hi all: A new problem comes to me, maybe some of you have already experience on it. Because of the file size (18 MB), I split this excel file (containing VB code) in two files A and B. Now is the problem: 1. The Config sheet of file A contains some data which will be used by two files. In this sheet are several Ranges defined. These range are used by other sheets which are now in both files and in VB code. Question: 1. How can I make a reference to a range in file Afrom VB code in file B? I have tried to use like for each a in [A]Config!ref_range or: for each a in ["A"]Config!ref_range Neither woks. 2. I opened the linked excel file A with VB program. Is it unnessary because there are already links between sheets? Will two instance of the excel file A be opened? If I don't do it in VB, the VB code doesn't run. Is there a better way to do it? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference of Range in another file with VB
Thank you, it works with
workbooks(...).Worksheets(...).range("...").cells You have saved my day. On 2 Nov., 12:19, "Tim Williams" <timjwilliams at gmail dot com wrote: dim c as range for each c in workbooks("A.xls").range("ref_range").cells 'do stuff next c Tim "Steven P" wrote in message ups.com... Hi all: A new problem comes to me, maybe some of you have already experience on it. Because of the file size (18 MB), I split this excel file (containing VB code) in two files A and B. Now is the problem: 1. The Config sheet of file A contains some data which will be used by two files. In this sheet are several Ranges defined. These range are used by other sheets which are now in both files and in VB code. Question: 1. How can I make a reference to a range in file Afrom VB code in file B? I have tried to use like for each a in [A]Config!ref_range or: for each a in ["A"]Config!ref_range Neither woks. 2. I opened the linked excel file A with VB program. Is it unnessary because there are already links between sheets? Will two instance of the excel file A be opened? If I don't do it in VB, the VB code doesn't run. Is there a better way to do it?- Zitierten Text ausblenden - - Zitierten Text anzeigen - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking to another file using file reference typed cell | Excel Worksheet Functions | |||
automatic range - named range give me circular reference... | Excel Discussion (Misc queries) | |||
Can you get the range reference for each page in a worksheet print range? | Excel Programming | |||
How do I reference external data from a file, file name found in . | Excel Discussion (Misc queries) | |||
adding reference-to-range control to excel range | Excel Programming |