Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default from "all sheets except" to "all sheets after"


How do I change the following to refer to all sheets after rather than
all sheets except

Reason is, I am adding an additional sheet to the beginning of the
workbook.


On Error Resume Next
For Each ws In Worksheets
If ws.Name < "Data Sheet" Then
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default from "all sheets except" to "all sheets after"

For Each ws In Worksheets
If ws.Index Sheets("Data Sheet").Index Then
'your code
End If
Next

If this post helps click Yes
---------------
Jacob Skaria


"J.W. Aldridge" wrote:


How do I change the following to refer to all sheets after rather than
all sheets except

Reason is, I am adding an additional sheet to the beginning of the
workbook.


On Error Resume Next
For Each ws In Worksheets
If ws.Name < "Data Sheet" Then

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default from "all sheets except" to "all sheets after"

for each ws in worksheets
msgbox ws.name 'for example
next ws



"J.W. Aldridge" wrote:

How do I change the following to refer to all sheets after rather than
all sheets except

Reason is, I am adding an additional sheet to the beginning of the
workbook.

On Error Resume Next
For Each ws In Worksheets
If ws.Name < "Data Sheet" Then


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default from "all sheets except" to "all sheets after"

On Apr 20, 12:09*pm, "J.W. Aldridge"
wrote:
How do I change the following to refer to all sheets after rather than
all sheets except

Reason is, I am adding an additional sheet to the beginning of the
workbook.

On Error Resume Next
For Each ws In Worksheets
If ws.Name < "Data Sheet" Then


Provided that all of your sheets are worksheets:

Best,

Matthew Herbert

Sub CertainSheets()
Dim intWksMarker As Integer
Dim intA As Integer

intWksMarker = Worksheets("Data Sheet").Index
intWksMarker = intWksMarker + 1

For intA = intWksMarker To Worksheets.Count
MsgBox Worksheets(intA).Name
Next

End Sub
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
"Count" and "List" functions across sheets Meg Excel Worksheet Functions 0 October 14th 08 02:11 PM
Whats wrong with this? MyWBAccRep.Sheets("Volumes").Cells.Find("latest").Copy.Offset(0, Simon[_2_] Excel Programming 2 August 11th 08 01:29 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 12:16 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"