ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¨Ï¥Î¨Æ¥óµ{§Ç¶}±Ò¶W³sµ²(ÁôÂÃ/Åã¥Ü¤u§@ªí)

[µo°Ý] ¨Ï¥Î¨Æ¥óµ{§Ç¶}±Ò¶W³sµ²(ÁôÂÃ/Åã¥Ü¤u§@ªí)

¦U¦ì«e½ú¦n¡A
¸Õ¼gªþ¥ó¡A·Q°µ¨ìªº®ÄªG¦p¤U
¤u§@ªí1(¥Ã»·Åã¥Ü)¡A¸Ì­±¦³¤u§@ªí2!A1»P¤u§@ªí3!A1ªº¶W³sµ²¡AÂI¿ï¶W³sµ²·|¨ì³s¨ì¹ïÀ³¤u§@ªíªºA1¡A
¤u§@ªí2 & 3(ÁôÂáA¶È¦bÂI¿ï¤u§@ªí1«áÅã¥Ü)

¤u§@ªí1¨Ï¥Î¨Æ¥óµ{§Ç
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
¹F¦¨ÂI¿ï¶W³sµ²¨ä¹ïÀ³ªº¤u§@ªíÅܬ°Åã¥Ü

¤u§@ªí2 & 3¨Ï¥Î¨Æ¥óµ{§Ç
Private Sub Worksheet_Deactivate()
¹F¦¨Â÷¶}¤u§@ªí§YÁôÂ湤u§@ªí

¹J¨ìªº°ÝÃD¦p¤U
1.²Ä¤@¦¸ÂI¿ï¤u§@ªí1ªº¶W³sµ²¡A¹ïÀ³ªº¤u§@ªíÅܬ°Åã¥Ü¦ý¤£·|³s¨ì¹ïÀ³¤u§@ªíªºA1¡A­nÂI²Ä¤G¦¸¤u§@ªí1ªº¶W³sµ²¤~·|³s¨ì¹ïÀ³¤u§@ªíªºA1¡A¯à§_¹F¦¨¶ÈÂI¤@¦¸§Y§¹¦¨Åã¥Ü¹ïÀ³¤u§@ªí&³s¨ìA1?
2.¤u§@ªí2 & 3ªºcoding¡A¯à§_¤£«ü©w¦WºÙ§Y§PÂ_¦¹¤u§@ªí»ÝÁôÂÃ?
sshot-12.jpg

ÁÂÁÂ
¶W³sµ².rar (14.48 KB)

ThisWorkbook.Worksheets("¤u§@ªí2").Visible = False
¦b¤u§@ªí¨Æ¥ó°Ï, ¥i¥H³o¼Ë¼g
Me.Visible = False
================================
¥t¥~, ±N"¤u§@ªí2"¤Î"¤u§@ªí3"ªº¦Û°ÊÁôÂõ{¦¡½X§R°£, ¨Ã±N¨ä³]¬°¥i¨£,
±N¤u§@ªí1ªº¶W³sµ²¨Æ¥ó§ï¬°¦p¤U:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheet_Name = ActiveCell.Value
MsgBox Sheet_Name
End Sub

°õ¦æ"¶W³sµ²", ·|µo²{Sheet_Name¬O"¤u§@ªí1", ¦Ó¤£¬O¨ä¥¦,
ªí¥Ü³o­ÓActiveCell, ¬O³Q³sµ²¤u§@ªíÀx¦s®æªº¤º®e, ¦Ó¤£¬O¤u§@ªí1ªºa1¤º®e~~
==================================
±N¤u§@ªí2ªºA1¤º®e, §ï¦¨"¤u§@ªí15", ¦A¥Î§A­ì¨ÓÀɮתºµ{¦¡½X¸Õ¸Õ,
ÂI²Ä¤@¦¸¶W³sµ², ¤u§@ªí2Åã¥Ü¬°¥i¨£, ¦ýµe­±ÁÙ¬O¯d¦b¤u§@ªí1,
¦AÂI¤@¦¸¶W³sµ², ·|¶]¨ì¤u§@ªí2, ¦ýµ{¦¡½X·|¸õ¥X¿ù»~, ¦]¬°"¤u§@ªí15"¨Ã¤£¦s¦b~


=======================

TOP

¦AªÌ, ÁöµM¤u§@2¦³
Private Sub Worksheet_Deactivate()
Me.Visible = False
End Sub

ª½±µ¿ï¨ú¨ä¥¦¤u§@ªí, ¤u§@ªí2·|¦Û°ÊÁôÂèS°ÝÃD,
¦ý­YÂIA1¶W³sµ², ·|¶]¨ì¤u§@ªí1, ¤u§@ªí2¤´µM¬OÅã¥Üªº


================================

TOP

¦^´_ 3# ­ã´£³¡ªL
·PÁ¦^ÂСAÀò¯q¨}¦h¡A­×§ï¤F¤@¤Uµ{¦¡¦pªþ¥ó ¶W³sµ².rar (14.65 KB)

²{¦b¹J¨ìªº°ÝÃD¬O­Y¤u§@ªí2 and 3¬°ÁôÂáA²Ä¤@¦¸ÂI¿ï¤u§@ªí1ªº³sµ²·|¨Ï¤u§@ªí2 or 3Åܬ°Åã¥Ü¡A¦ýactivesheetÁÙ¬O¤u§@ªí1¡A²Ä¤G¦¸ÂI¤u§@ªí1ªº³sµ²activesheet´N·|Åܬ°¤u§@ªí2 or 3¡C

·Q­n¹F¦¨ªº®ÄªG¬O¤u§@ªí2 and 3¬°ÁôÂáAÂI¿ï¤u§@ªí1ªº³sµ²«h·|¨Ï¤u§@ªí2 or 3Åܬ°Åã¥Ü¥Bactivesheet¬°¤u§@ªí2 or 3¡C

­Y¯à¹F¦¨¦¹®ÄªG¡AÀ³¯àÁקK¤U¦C°ÝÃD
¦AªÌ, ÁöµM¤u§@2¦³
Private Sub Worksheet_Deactivate()
Me.Visible = False
End Sub

ª½±µ¿ï¨ú¨ä¥¦¤u§@ªí, ¤u§@ªí2·|¦Û°ÊÁôÂèS°ÝÃD,
¦ý­YÂIA1¶W³sµ², ·|¶]¨ì¤u§@ªí1, ¤u§@ªí2¤´µM¬OÅã¥Üªº

TOP

¦^´_ 4# chiata

¸Õ¸Õ¬Ý:
Xl0000419.rar (11.48 KB)

TOP

¦^´_  chiata

¸Õ¸Õ¬Ý:
­ã´£³¡ªL µoªí©ó 2019-7-18 19:21

·PÁ¥Τߦ^ÂСAÀò¯q¨}¦h¡A
´X­Ó°ÝÃDÁÙ·Q½Ð±Ð
  1. Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
  2. Dim SR
  3. If ActiveSheet.Name <> Me.Name Then Exit Sub
  4.    
  5.     With ActiveCell
  6.          If .Hyperlinks.Count = 0 Then Exit Sub
  7.          SR = Split(Replace(.Hyperlinks(1).SubAddress, "'", ""), "!")
  8.          If SR(0) = Me.Name Then Exit Sub
  9.          Sheets(SR(0)).Visible = True
  10.          Application.Goto Sheets(SR(0)).Range(SR(1))
  11.     End With
  12.    
  13. End Sub
½Æ»s¥N½X
ActiveCell.Hyperlinks.Count À³¸Ó¬O«ü¦¹Àx¦s®æªº¶W³sµ²¼Æ¶q¡A­Y¥HÀx¦s®æ¨Ó¬Ý¡A³Ì¦h¬°1?
¦Ó¦¹coding¬OÂI¿ï¶W³sµ²¤~·|°õ¦æ¡A¬GActiveCell.Hyperlinks.Count=1?
¨º¬°¦ó»Ý­nIf .Hyperlinks.Count = 0 Then Exit Sub?

.Hyperlinks(1).SubAddress¬A¸¹¤¤ªº1¬O¤£¬OÃþ¦üworksheets(1)?
­Y¬°worksheets("¤u§@ªí1")¡A½d³ò¤¤¦³2­Ó¶W³sµ²¡A¸Ó«ç»ò§PÂ_Hyperlinks(1) & Hyperlinks(2)?

ÁÂÁÂ!

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD