View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default userforms / worksheets

Hi J

That depends. Is Sheet 2 the second sheet from the left ? If so

Select Case ActiveSheet.Index
Case 2
MsgBox "Yo"
Case Else
'...

Ensure that users can't move, delete, insert sheets if so.
If Sheet 2 is the sheet name then

Select Case ActiveSheet.Name
Case "Sheet 2"
MsgBox "Yo"
Case Else
'...

Ensure that users can't rename the sheets if so.
Then you have code names (=name in the project explorer, like Sheet2). But
maybe there's an even better identifier or way to do this ?

HTH. Best wishes Harald

"Gixxer_J_97" skrev i melding
...
i am writing a help system for my vba/excel project
the help is launched from a button on each worksheet in the workbook
each button calls the same help system

the help is built with a userform and a multi-page

how do i detect which worksheet the help was launched from in order to set
the mult-page to the correct page?

ie if the user is on 'sheet 2' and they click the help button, the help

will
come up and display 'page 2'

tia

J