Thread: worksheets
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
peyman peyman is offline
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.