PC Review


Reply
Thread Tools Rate Thread

browsing between worksheets ?

 
 
=?Utf-8?B?ZXhjZWwtdHI=?=
Guest
Posts: n/a
 
      8th Mar 2007
Hi,

for example assume , I have 30 workbooks and 30 worksheets in each
workbook.totally 900 worksheets. I do not want to open each workbook to
browse, there must be a way to see all worksheets in a way ? in a list ?
--
SAHRAYICEDIT-ISTANBUL

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      8th Mar 2007
Couldn't find the original link to the code courtesy of Ozgrid so had to
paste it in here. Copy this code to a new module and run it. Your workbook
must have a Sheet1 in it or alter the code to where you want the output to be

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
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
Set wbResults = Workbooks.Open(.FoundFiles(i))

wbCodeBook.Sheets(1).Range _
("A65536").End(xlUp)(2, 1) = UCase(wbResults.Name)
For Each wSheet In wbResults.Worksheets
wbCodeBook.Sheets(1).Range _
("A65536").End(xlUp)(2, 1) = wSheet.Name
Next wSheet
wbResults.Close SaveChanges:=False
Next i
End If
End With

On Error GoTo 0
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub

Will that do?

Mike

"excel-tr" wrote:

> Hi,
>
> for example assume , I have 30 workbooks and 30 worksheets in each
> workbook.totally 900 worksheets. I do not want to open each workbook to
> browse, there must be a way to see all worksheets in a way ? in a list ?
> --
> SAHRAYICEDIT-ISTANBUL
>

 
Reply With Quote
 
=?Utf-8?B?ZXhjZWwtdHI=?=
Guest
Posts: n/a
 
      8th Mar 2007
dear mike,

super code thanks a lot. is it possible to put each sheet name in to a
listbox automatically then I will click which I want to see .

regards.
--
SAHRAYICEDIT-ISTANBUL


"Mike":

> Couldn't find the original link to the code courtesy of Ozgrid so had to
> paste it in here. Copy this code to a new module and run it. Your workbook
> must have a Sheet1 in it or alter the code to where you want the output to be
>
> 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
> .FileType = msoFileTypeExcelWorkbooks
> If .Execute > 0 Then
> For i = 1 To .FoundFiles.Count
> Set wbResults = Workbooks.Open(.FoundFiles(i))
>
> wbCodeBook.Sheets(1).Range _
> ("A65536").End(xlUp)(2, 1) = UCase(wbResults.Name)
> For Each wSheet In wbResults.Worksheets
> wbCodeBook.Sheets(1).Range _
> ("A65536").End(xlUp)(2, 1) = wSheet.Name
> Next wSheet
> wbResults.Close SaveChanges:=False
> Next i
> End If
> End With
>
> On Error GoTo 0
> Application.ScreenUpdating = True
> Application.DisplayAlerts = True
> Application.EnableEvents = True
> End Sub
>
> Will that do?
>
> Mike
>
> "excel-tr" wrote:
>
> > Hi,
> >
> > for example assume , I have 30 workbooks and 30 worksheets in each
> > workbook.totally 900 worksheets. I do not want to open each workbook to
> > browse, there must be a way to see all worksheets in a way ? in a list ?
> > --
> > SAHRAYICEDIT-ISTANBUL
> >

 
Reply With Quote
 
=?Utf-8?B?ZXhjZWwtdHI=?=
Guest
Posts: n/a
 
      12th Mar 2007
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


"Mike":

> Couldn't find the original link to the code courtesy of Ozgrid so had to
> paste it in here. Copy this code to a new module and run it. Your workbook
> must have a Sheet1 in it or alter the code to where you want the output to be
>
> 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
> .FileType = msoFileTypeExcelWorkbooks
> If .Execute > 0 Then
> For i = 1 To .FoundFiles.Count
> Set wbResults = Workbooks.Open(.FoundFiles(i))
>
> wbCodeBook.Sheets(1).Range _
> ("A65536").End(xlUp)(2, 1) = UCase(wbResults.Name)
> For Each wSheet In wbResults.Worksheets
> wbCodeBook.Sheets(1).Range _
> ("A65536").End(xlUp)(2, 1) = wSheet.Name
> Next wSheet
> wbResults.Close SaveChanges:=False
> Next i
> End If
> End With
>
> On Error GoTo 0
> Application.ScreenUpdating = True
> Application.DisplayAlerts = True
> Application.EnableEvents = True
> End Sub
>
> Will that do?
>
> Mike
>
> "excel-tr" wrote:
>
> > Hi,
> >
> > for example assume , I have 30 workbooks and 30 worksheets in each
> > workbook.totally 900 worksheets. I do not want to open each workbook to
> > browse, there must be a way to see all worksheets in a way ? in a list ?
> > --
> > SAHRAYICEDIT-ISTANBUL
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
browsing worksheets between different workbooks =?Utf-8?B?ZXhjZWwtdHI=?= Microsoft Excel Programming 2 3rd Mar 2007 11:31 PM
Copy data from multiple worksheets to worksheets in a number of other spreadsheets SteveH Microsoft Excel Discussion 5 6th Nov 2006 06:59 PM
SHARED WEB BROWSING / CO-BROWSING ? Sabian Smith Windows XP General 3 16th Jan 2005 09:54 AM
Worksheets are referenced in expressions, how make the worksheets visible? Excel 2000 L Mehl Microsoft Excel Misc 2 27th Jul 2004 07:20 PM
hotkey for browsing through worksheets Robert Microsoft Excel Misc 3 11th May 2004 09:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:33 PM.