getting worksheet names


G

Guest

hi,
I added below code, but I cannot see worksheet names in workbooks in sub
folders ? what is the problem ?

SearchSubFolders = IncludeSubFolder

If I want to see the directory of each worksheet next to the name of it how
can we revise the code?
for example;
book ( name of worksheet ) D:\library\...
--
SAHRAYICEDIT-ISTANBUL


Sub GetAllWorksheetNames()
Dim i As Integer
Dim wbResults As Workbook
Dim wbCodeBook As Workbook
Dim wSheet As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False

On Error Resume Next

Set wbCodeBook = ThisWorkbook

With Application.FileSearch
.NewSearch
.LookIn = "C:\my documents" 'amend to suit
SearchSubFolders = IncludeSubFolder
 
Ad

Advertisements

H

Helmut Weber

Hi,

try:

..SearchSubFolders = True

I dont know, where "IncludeSubFolder" comes from.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top