Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Copy values only onto new workbook | Excel Discussion (Misc queries) | |||
comparing values from one workbook with another workbook | Excel Discussion (Misc queries) | |||
Adding values from different workbook | Excel Discussion (Misc queries) | |||
How do I call number values form one workbook to another workbook | Excel Worksheet Functions | |||
Setting values in another workbook | Excel Programming |