ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading Data From Series of External Workbooks (https://www.excelbanter.com/excel-programming/280175-reading-data-series-external-workbooks.html)

Marston[_2_]

Reading Data From Series of External Workbooks
 
I have an application I've written that pulls data from several other
workbooks in order to perform some calculations.

Right now I have it set up where I make very specific definitions
in the VB code:

Set Range = Worksheets("NamedWorkbook").Range("NamedRange")

However, this is very cumbersome because it requires too much manipulation
How can I alter my code so that users can be queried for what workbook/range
combinations match a particular request without having to name the range.

Perferable, I'd what the user to just input the name of the workbook and the
appropriate corresponding range.

steve

Reading Data From Series of External Workbooks
 
Marston,

Maybe a form with comboboxes for Workbook name and for Range???
Helps prevent typos...

--
sb
"Marston" wrote in message
om...
I have an application I've written that pulls data from several other
workbooks in order to perform some calculations.

Right now I have it set up where I make very specific definitions
in the VB code:

Set Range = Worksheets("NamedWorkbook").Range("NamedRange")

However, this is very cumbersome because it requires too much manipulation
How can I alter my code so that users can be queried for what

workbook/range
combinations match a particular request without having to name the range.

Perferable, I'd what the user to just input the name of the workbook and

the
appropriate corresponding range.




Tom Ogilvy

Reading Data From Series of External Workbooks
 
Look in help for Application.Inputbox( Type:=8)

This allows the user to select a range with the mouse.

Dim rng as Range
set rng = nothing
On Error Resume Next
set rng = Application.InputBox("Select range with mouse", Type:=8)
On Error goto 0
if rng is nothing then
msgbox "You didn't select a range, exiting"
exit sub
End if
msgbox "You selected: " & rng.Address(0,0,External:=True)

--
Regards.
Tom Ogilvy

"Marston" wrote in message
om...
I have an application I've written that pulls data from several other
workbooks in order to perform some calculations.

Right now I have it set up where I make very specific definitions
in the VB code:

Set Range = Worksheets("NamedWorkbook").Range("NamedRange")

However, this is very cumbersome because it requires too much manipulation
How can I alter my code so that users can be queried for what

workbook/range
combinations match a particular request without having to name the range.

Perferable, I'd what the user to just input the name of the workbook and

the
appropriate corresponding range.





All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com