Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I had a list of files (full file path), how could I loop through them and
capture all the sheet names within each file. For example, file names in column A, sheet names in B forward. Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range, cell as Range, sh as Worksheet
Dim j as Long set rng = Range(cells(1,1),Cells(1,1).End(xldown)) for each cell in rng set bk = Workbooks.Open(cell.Value) j = 2 for each sh in bk.Worksheets cells(cell.row,j).Value = sh.name j = j + 1 Next bk.close SaveChanges:=False Next -- Regards, Tom Ogilvy "Steph" wrote in message ... If I had a list of files (full file path), how could I loop through them and capture all the sheet names within each file. For example, file names in column A, sheet names in B forward. Thank you! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fantastic! Thank you!
"Tom Ogilvy" wrote in message ... Dim rng as Range, cell as Range, sh as Worksheet Dim j as Long set rng = Range(cells(1,1),Cells(1,1).End(xldown)) for each cell in rng set bk = Workbooks.Open(cell.Value) j = 2 for each sh in bk.Worksheets cells(cell.row,j).Value = sh.name j = j + 1 Next bk.close SaveChanges:=False Next -- Regards, Tom Ogilvy "Steph" wrote in message ... If I had a list of files (full file path), how could I loop through them and capture all the sheet names within each file. For example, file names in column A, sheet names in B forward. Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Determine Excel file version with no file extension. | Excel Discussion (Misc queries) | |||
How can I determine which sheets meet criteria? | Excel Discussion (Misc queries) | |||
Determine what sheets are linked to sheet A | Links and Linking in Excel | |||
In 3 active sheets in wkbk, determine& display the # of sheets that have data | Excel Discussion (Misc queries) | |||
How do I determine if it is a new file or an existing file? | Excel Programming |