Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Values from another workbook

I have two workbooks open. Workbook A and workbook B

Workbook B has some data in a column named as a range "rng_Data" (Variable
range : with Offset formula)

I want to access the same data in workbook A

Below is what i will do to get all the values of the range if it would have
been in the same workbook. What would i do to get the values of a range from
another workbook (which is open) ?

For Each c In Range(rng_Data)
str_Values = str_Values & ", " & c
Next

msgbox str_Values




--
Ajit
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Values from another workbook

set rng = Workbooks("WorkbookB.xls").Names("rng_Data").Refer sToRange
for each c in rng
str_Values = str_Values & "," & c
Next

msgbox Left(str_Values,len(str_Values)-1)

--
Regards,
Tom Ogilvy


"Ajit" wrote in message
...
I have two workbooks open. Workbook A and workbook B

Workbook B has some data in a column named as a range "rng_Data" (Variable
range : with Offset formula)

I want to access the same data in workbook A

Below is what i will do to get all the values of the range if it would

have
been in the same workbook. What would i do to get the values of a range

from
another workbook (which is open) ?

For Each c In Range(rng_Data)
str_Values = str_Values & ", " & c
Next

msgbox str_Values




--
Ajit



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Values from another workbook

Thanks, Tom..
It works perfect.

Just querious to know that can we refer to the range in other workbook in
rng_data...keeping the below loop as it is?

For Each c In Range(rng_Data)
str_Values = str_Values & ", " & c
Next


"Tom Ogilvy" wrote:

set rng = Workbooks("WorkbookB.xls").Names("rng_Data").Refer sToRange
for each c in rng
str_Values = str_Values & "," & c
Next

msgbox Left(str_Values,len(str_Values)-1)

--
Regards,
Tom Ogilvy


"Ajit" wrote in message
...
I have two workbooks open. Workbook A and workbook B

Workbook B has some data in a column named as a range "rng_Data" (Variable
range : with Offset formula)

I want to access the same data in workbook A

Below is what i will do to get all the values of the range if it would

have
been in the same workbook. What would i do to get the values of a range

from
another workbook (which is open) ?

For Each c In Range(rng_Data)
str_Values = str_Values & ", " & c
Next

msgbox str_Values




--
Ajit




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Values from another workbook

One workbook has no knowledge of the names in another workbook to the best
of my knowledge.

--
Regards,
Tom Ogilvy

"Ajit" wrote in message
...
Thanks, Tom..
It works perfect.

Just querious to know that can we refer to the range in other workbook in
rng_data...keeping the below loop as it is?

For Each c In Range(rng_Data)
str_Values = str_Values & ", " & c
Next


"Tom Ogilvy" wrote:

set rng = Workbooks("WorkbookB.xls").Names("rng_Data").Refer sToRange
for each c in rng
str_Values = str_Values & "," & c
Next

msgbox Left(str_Values,len(str_Values)-1)

--
Regards,
Tom Ogilvy


"Ajit" wrote in message
...
I have two workbooks open. Workbook A and workbook B

Workbook B has some data in a column named as a range "rng_Data"

(Variable
range : with Offset formula)

I want to access the same data in workbook A

Below is what i will do to get all the values of the range if it would

have
been in the same workbook. What would i do to get the values of a

range
from
another workbook (which is open) ?

For Each c In Range(rng_Data)
str_Values = str_Values & ", " & c
Next

msgbox str_Values




--
Ajit






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
VBA Copy values only onto new workbook Mara Excel Discussion (Misc queries) 1 May 5th 10 02:43 AM
comparing values from one workbook with another workbook dpdave Excel Discussion (Misc queries) 3 February 10th 10 04:55 PM
Adding values from different workbook Rich Excel Discussion (Misc queries) 0 May 7th 09 04:53 PM
How do I call number values form one workbook to another workbook Teryn Excel Worksheet Functions 3 December 29th 07 09:21 AM
Setting values in another workbook Ecco Excel Programming 1 July 17th 03 08:15 AM


All times are GMT +1. The time now is 04:52 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"