#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default worksheets

hi,
Kevin has posted for me the following code in which "HYPERLINK" is a
subRoutine.the code cycles thru all the worksheets.I wanna know if there is
any way to get the procedure cycle only thru the first 3 worksheets.the first
three worksheets have different names?

Private Sub CommandButton18_Click()
Dim ws as Worksheet
For Each ws in ThisWorkBook.Worksheets
ws.Activate
HYPERLINK
Next ws
end sub
thanx.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default worksheets

Private Sub CommandButton18_Click()
dim wCtr as long
for wctr = 1 to 3
worksheets(wctr).Activate
myHYPERLINK
Next wctr
end sub

ps. I don't think I'd use Hyperlink as a name as a subroutine.

peyman wrote:

hi,
Kevin has posted for me the following code in which "HYPERLINK" is a
subRoutine.the code cycles thru all the worksheets.I wanna know if there is
any way to get the procedure cycle only thru the first 3 worksheets.the first
three worksheets have different names?

Private Sub CommandButton18_Click()
Dim ws as Worksheet
For Each ws in ThisWorkBook.Worksheets
ws.Activate
HYPERLINK
Next ws
end sub
thanx.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default worksheets

Just SHIFT + click to select the sheets then run

Private Sub CommandButton18_Click()
Dim ws as Worksheet
For Each ws in ActiveWindow.SelectedSheets
ws.Activate
HYPERLINK
Next ws
End sub


Gord Dibben MS Excel MVP

On Thu, 11 Oct 2007 09:15:07 -0700, peyman
wrote:

hi,
Kevin has posted for me the following code in which "HYPERLINK" is a
subRoutine.the code cycles thru all the worksheets.I wanna know if there is
any way to get the procedure cycle only thru the first 3 worksheets.the first
three worksheets have different names?

Private Sub CommandButton18_Click()
Dim ws as Worksheet
For Each ws in ThisWorkBook.Worksheets
ws.Activate
HYPERLINK
Next ws
end sub
thanx.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default worksheets

thanx Dave.

"Dave Peterson" wrote:

Private Sub CommandButton18_Click()
dim wCtr as long
for wctr = 1 to 3
worksheets(wctr).Activate
myHYPERLINK
Next wctr
end sub

ps. I don't think I'd use Hyperlink as a name as a subroutine.

peyman wrote:

hi,
Kevin has posted for me the following code in which "HYPERLINK" is a
subRoutine.the code cycles thru all the worksheets.I wanna know if there is
any way to get the procedure cycle only thru the first 3 worksheets.the first
three worksheets have different names?

Private Sub CommandButton18_Click()
Dim ws as Worksheet
For Each ws in ThisWorkBook.Worksheets
ws.Activate
HYPERLINK
Next ws
end sub
thanx.


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default worksheets

thank you Gord,but I'd prefer to handle it without the SHIFT + click .thanx
anyway.

"Gord Dibben" wrote:

Just SHIFT + click to select the sheets then run

Private Sub CommandButton18_Click()
Dim ws as Worksheet
For Each ws in ActiveWindow.SelectedSheets
ws.Activate
HYPERLINK
Next ws
End sub


Gord Dibben MS Excel MVP

On Thu, 11 Oct 2007 09:15:07 -0700, peyman
wrote:

hi,
Kevin has posted for me the following code in which "HYPERLINK" is a
subRoutine.the code cycles thru all the worksheets.I wanna know if there is
any way to get the procedure cycle only thru the first 3 worksheets.the first
three worksheets have different names?

Private Sub CommandButton18_Click()
Dim ws as Worksheet
For Each ws in ThisWorkBook.Worksheets
ws.Activate
HYPERLINK
Next ws
end sub
thanx.



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
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
how do i copy a cell in worksheets 10 to the other 9 worksheets bete New Users to Excel 3 March 15th 07 10:41 AM
Worksheets DebbieS Excel Discussion (Misc queries) 5 March 4th 07 07:03 PM
How do i assign the ActiveWorkbook.Worksheets to a worksheets object? TS Excel Worksheet Functions 2 December 27th 06 02:49 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM


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