I'm trying to find some non vba approach to grabbing the tab names in workbook A and assigning them to a group of cells in workbook B
I have no clue...
A backup plan would be to go with vba
I'm trying to find some non vba approach to grabbing the tab names in workbook A and assigning them to a group of cells in workbook B
I have no clue...
A backup plan would be to go with vba
Last edited by SDruley; 11-09-2010 at 06:09 PM.
Turn Data into Information
Turn Information into Knowledge
Turn Knowledge into Direction
Turn Direction into Leadership
Turn Leadership into Results
Stephen Druley
It's not how quickly you think
But how deeply you think
The quality of thinking is measured
by remoteness to conformance
Stephen Druley
Is Workbook A always open when Workbook B is being used ?
If so would XLM be permitted ?
(old Macros but run via Names - pre XL2007 would not generate macro warning etc...)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
I guess I should outline my thinking... you could use a Name in Workbook A to store the sheet names:
You could then (to avoid issues re: closed file) add a sheet to Workbook A to list the sheet names - eg create a sheet called "sheetlist" and then![]()
Name: _Sheets RefersTo: =GET.WORKBOOK(1)
You can then link to these cells from Workbook B as normal![]()
A1: =INDEX(_Sheets,ROWS(A$1:A1)) copied down as far as necessary
(handling #REF! errors etc and trimming the references to remove the file name via formulae in Workbook B)
Thank you DonkeyOte and Sweep...
Both Workbooks are always open. Since no program is always the best program, I am going to go with DonkeyOte's approach.
I will write back with my results.. still working on it.
My two simple workbook examples are attached. Still having some trouble following through.
I'm not really sure from looking at the Names you've created in A what you want to do exactly.
GET.WORKBOOK(1) will return a horizontal array of the sheet names so you can use INDEX etc to retrieve the various items - per earlier post:
Then in terms of the listing returned to a range (for closed target purposes)![]()
Name: _Sheets RefersTo: =GET.WORKBOOK(1)
If you would prefer to tweak the sheet names in place I would suggest an adjacent cell for simplicity sake:![]()
Sheets!A1 =INDEX(_Sheets,ROWS(A$1:A1)) copied down
In workbookB Link to B1 etc in WorkbookA!Sheets![]()
Sheets!B1 =IF(ISTEXT(A1),REPLACE(A1,1,FIND("]",A1),""),"") copied down (you could use IFERROR if to be used excl. XL2007+)
If you decide to go for the backup plan:
![]()
Sub a() Dim ws As Worksheet, iCount As Integer iCount = 1 For Each ws In Workbooks("Bookname_Name.xls").Worksheets Cells(iCount, 1).Value = ws.Name iCount = iCount + 1 Next End Sub
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks