Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Work book event code help (re Bob Phillips)

I have a worksheet that has numerous sheets in it that the code shown below
which was developed by Bob Phillips when run lists all the remaining shees in
a range of cells in the first sheet in the workbook (which is named
'Operations'). What I would like to do with this code is to modify it so it
skips 2 sheets that may or may not still be in the copied workbook. These 2
sheets are named 'Strippit Radan' & 'Burner Radan'. Would someone please
help me with this?

I have listed the code below & below that I copied my original request for
background info.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n As Long
Dim i As Long
Dim j As Long

If Target.Address = "$E$25" Then
n = Worksheets.Count
j = 0
For i = 1 To n
sh = Worksheets(i).Name
If sh < "blank" Then
Target.Offset(j, 0).Value = sh
j = j + 1
End If
Next
End If
End Sub


Original request

I have an Excel 2003 workbook that has 12 sheets in it. This workbook is the
master copy that is copied into each one of our job folders as a new job is
created. The first sheet is always kept in the workbook, but the remainder of
the sheets are not always kept in the copied workbooks. The jobs vary in what
work centers in our shop are required for each job. If a work center is not
required for a specific job, I delete that work centers sheet from the copied
wook book. For simplicity, assuming that the sheets are named A, B, C,....
and that sheet A is always kept in the copied wookbook., is there a way that
I can get the remaining sheet names to be displayed in cells in sheet A.

What I would like to accomplish is a sequential block of cells that display
the remaining sheets names with no gaps between the cells with the displayed
names in them.

Can someone help me with this please??

Thank You,

Gary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Work book event code help (re Bob Phillips)

On Nov 8, 11:08 am, Dingy101
wrote:
I have a worksheet that has numerous sheets in it that the code shown below
which was developed by Bob Phillips when run lists all the remaining shees in
a range of cells in the first sheet in the workbook (which is named
'Operations'). What I would like to do with this code is to modify it so it
skips 2 sheets that may or may not still be in the copied workbook. These 2
sheets are named 'Strippit Radan' & 'Burner Radan'. Would someone please
help me with this?

I have listed the code below & below that I copied my original request for
background info.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n As Long
Dim i As Long
Dim j As Long

If Target.Address = "$E$25" Then
n = Worksheets.Count
j = 0
For i = 1 To n
sh = Worksheets(i).Name
If sh < "blank" Then
Target.Offset(j, 0).Value = sh
j = j + 1
End If
Next
End If
End Sub

Original request

I have an Excel 2003 workbook that has 12 sheets in it. This workbook is the
master copy that is copied into each one of our job folders as a new job is
created. The first sheet is always kept in the workbook, but the remainder of
the sheets are not always kept in the copied workbooks. The jobs vary in what
work centers in our shop are required for each job. If a work center is not
required for a specific job, I delete that work centers sheet from the copied
wook book. For simplicity, assuming that the sheets are named A, B, C,....
and that sheet A is always kept in the copied wookbook., is there a way that
I can get the remaining sheet names to be displayed in cells in sheet A.

What I would like to accomplish is a sequential block of cells that display
the remaining sheets names with no gaps between the cells with the displayed
names in them.

Can someone help me with this please??

Thank You,

Gary


Hi Gary

that should work:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n As Long
Dim i As Long
Dim j As Long


If Target.Address = "$E$25" Then
n = Worksheets.Count
j = 0
For i = 1 To n
sh = Worksheets(i).Name
If sh < "blank" and sh < "Strippit Radan" and sh <
"Burner Radan" Then
Target.Offset(j, 0).Value = sh
j = j + 1
End If
Next
End If
End Sub


hth Carlo

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
work book open _ event Hassan Excel Worksheet Functions 1 July 3rd 08 12:49 PM
App_change event to open all work book [email protected] Excel Discussion (Misc queries) 1 August 2nd 07 03:52 PM
searching by number or code ina work book justsomeguy Excel Discussion (Misc queries) 0 February 19th 07 08:55 PM
Code to protect sheets, protects work book also? thiaga Excel Programming 7 March 2nd 06 11:00 PM
Please Help!!! How Do I Specify A particualr work book to execute code on MrGreenFingas Excel Programming 3 September 1st 05 12:08 PM


All times are GMT +1. The time now is 05:15 AM.

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"