uprichard
Programmer
- May 2, 2002
- 16
I have a workbook that has a number of sheets that each contain named ranges. I want to be able to pull out all the data that is contained within a given named range.
I use the following to return a single cell
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSh As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Dim strCellContents As String
Set xlBook = xlApp.Workbooks.Open("c:\my_book.xls")
strCellContents = xlBook.Worksheets("svo_test_01").Range("A1").Value
xlBook.Close savechanges:=False
xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
How can I return all the values for a named range?
I use the following to return a single cell
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSh As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Dim strCellContents As String
Set xlBook = xlApp.Workbooks.Open("c:\my_book.xls")
strCellContents = xlBook.Worksheets("svo_test_01").Range("A1").Value
xlBook.Close savechanges:=False
xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
How can I return all the values for a named range?