Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking to another file using file reference typed cell Steven Excel Worksheet Functions 3 April 5th 08 03:15 AM
automatic range - named range give me circular reference... George Thorogood Excel Discussion (Misc queries) 0 February 22nd 07 07:53 PM
Can you get the range reference for each page in a worksheet print range? Crosby Excel Programming 3 April 12th 05 06:06 PM
How do I reference external data from a file, file name found in . Clux Excel Discussion (Misc queries) 1 February 10th 05 10:52 PM
adding reference-to-range control to excel range Nir Sfez Excel Programming 1 March 2nd 04 06:11 PM


All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"