Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sub to aquire list of worksheets


AA2e72E Wrote:
Sub xx()
Range("A1").Select
For Each Sheet In ActiveWorkbook.Sheets
Select Case Sheet.Name
Case "EG1"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next
End Sub


Else Without If


Code
-------------------

Sub MacroAddNewFileListSheetNames()
' Creates a list of names of the sheets in SHEET Master Numbers, Column I (emitts Master Numbers)

Range("I1").Select
For Each Sheet In ActiveWorkbook.Worksheets
Select Case Sheet.Name
Case "Master Numbers"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next

End Su
-------------------

--
aking198
-----------------------------------------------------------------------
aking1987's Profile: http://www.excelforum.com/member.php...fo&userid=1539
View this thread: http://www.excelforum.com/showthread.php?threadid=31434

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Sub to aquire list of worksheets

Oops!

Replace the line

Else

by

Case Else

"aking1987" wrote:


AA2e72E Wrote:
Sub xx()
Range("A1").Select
For Each Sheet In ActiveWorkbook.Sheets
Select Case Sheet.Name
Case "EG1"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next
End Sub


Else Without If


Code:
--------------------

Sub MacroAddNewFileListSheetNames()
' Creates a list of names of the sheets in SHEET Master Numbers, Column I (emitts Master Numbers)

Range("I1").Select
For Each Sheet In ActiveWorkbook.Worksheets
Select Case Sheet.Name
Case "Master Numbers"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next

End Sub
--------------------


--
aking1987
------------------------------------------------------------------------
aking1987's Profile: http://www.excelforum.com/member.php...o&userid=15393
View this thread: http://www.excelforum.com/showthread...hreadid=314346


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Sub to aquire list of worksheets

The full solution (not e change from CElls.Row to ActiveCell.Row etc.):

Sub xx()
Range("A1").Select
For Each Sheet In ActiveWorkbook.Sheets
Select Case Sheet.Name
Case "EG1"
'Ignore
Case Else
ActiveCell.Value = Sheet.Name
Cells(ActiveCell.Row + 1, ActiveCell.Column).Activate
End Select
Next
End Sub



"AA2e72E" wrote:

Oops!

Replace the line

Else

by

Case Else

"aking1987" wrote:


AA2e72E Wrote:
Sub xx()
Range("A1").Select
For Each Sheet In ActiveWorkbook.Sheets
Select Case Sheet.Name
Case "EG1"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next
End Sub


Else Without If


Code:
--------------------

Sub MacroAddNewFileListSheetNames()
' Creates a list of names of the sheets in SHEET Master Numbers, Column I (emitts Master Numbers)

Range("I1").Select
For Each Sheet In ActiveWorkbook.Worksheets
Select Case Sheet.Name
Case "Master Numbers"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next

End Sub
--------------------


--
aking1987
------------------------------------------------------------------------
aking1987's Profile: http://www.excelforum.com/member.php...o&userid=15393
View this thread: http://www.excelforum.com/showthread...hreadid=314346


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Sub to aquire list of worksheets

!Same as below!

Sub xx()
Range("A1").Select
For Each Sheet In ActiveWorkbook.Sheets
Select Case Sheet.Name
Case "EG1"
'Ignore
Case Else
ActiveCell.Value = Sheet.Name
Cells(ActiveCell.Row + 1, ActiveCell.Column).Activate
End Select
Next
End Sub



"aking1987" wrote:


AA2e72E Wrote:
Sub xx()
Range("A1").Select
For Each Sheet In ActiveWorkbook.Sheets
Select Case Sheet.Name
Case "EG1"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next
End Sub


Else Without If


Code:
--------------------

Sub MacroAddNewFileListSheetNames()
' Creates a list of names of the sheets in SHEET Master Numbers, Column I (emitts Master Numbers)

Range("I1").Select
For Each Sheet In ActiveWorkbook.Worksheets
Select Case Sheet.Name
Case "Master Numbers"
'Ignore
Else
ActiveCell.Value = Sheet.Name
Cells(Cells.Row + 1, Cells.Column).Activate
End Select
Next

End Sub
--------------------


--
aking1987
------------------------------------------------------------------------
aking1987's Profile: http://www.excelforum.com/member.php...o&userid=15393
View this thread: http://www.excelforum.com/showthread...hreadid=314346


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of worksheets wally New Users to Excel 9 August 31st 08 07:01 PM
Get a list of worksheets from a WB John Scott Excel Discussion (Misc queries) 1 February 26th 06 05:47 PM
Sub to aquire list of worksheets aking1987[_9_] Excel Programming 4 November 17th 04 05:27 PM
Get a List of Worksheets glonka[_2_] Excel Programming 6 August 10th 04 10:52 PM
VBA list all worksheets glonka Excel Programming 2 August 10th 04 05:31 PM


All times are GMT +1. The time now is 02:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"