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

[µo°Ý] scrollbar ªº°ÝÃD

[µo°Ý] scrollbar ªº°ÝÃD

Private Sub ScrollBar1_Change()
With ScrollBar1
Sheets("sheet1").Range("H1").Value = Sheets("sheet1").Range("M2").Value
   .Max = Sheets("sheet1").Range("H1") + 5
   .Min = Sheets("sheet1").Range("H1") - 5
Sheets("sheet1").Range("H1") = .Value
   End With
end sub
ªì©l­È¤£¬O +5´N-5
¦p¦óÅýscrollbar h1ªì©l­È ==> µ¥©ó M2 ªº­È,MAX ¸òMIN ¤´µM¦³§@¥Î

¥»©«³Ì«á¥Ñ luhpro ©ó 2014-3-25 22:35 ½s¿è
Private Sub ScrollBar1_Change()
With ScrollBar1
Sheets("sheet1").Range("H1").Value = Sheets("sheet ...
t8899 µoªí©ó 2014-3-25 14:32

§Aªºµ{¦¡©ñ¿ù¦a¤è¤F.

³]©w ScrollBar ªº³Ì¤j­È»P³Ì¤p­È,
À³¸Ó¬O­n©ñ¦b  Worksheet_Change ¸Ì­±.

¦bµ{¦¡¶]¨ì Range H1 = M1 ¤§«á,
±µµÛ´N¨Ì¾Ú H1 ªº­È¥h³]©w ScrollBar ªº³Ì¤j­È»P³Ì¤p­È.

ScrollBar1_Change³o­Óµ{§Ç
¤@¯ë¬O¥Î¦b·í µ{¦¡¥hÅܧó ©Î User ¥Î·Æ¹«¥hÂI¿ï ScrollBar,
¶i¦Ó³y¦¨¨ä­È²§°Ê®É¨Ï¥Î.

TOP

§Aªºµ{¦¡©ñ¿ù¦a¤è¤F.

³]©w ScrollBar ªº³Ì¤j­È»P³Ì¤p­È,
À³¸Ó¬O­n©ñ¦b  Worksheet_Change ¸Ì­±.

¦b ...
luhpro µoªí©ó 2014-3-25 22:32


¨Æ¥óµ{§Ç«Å§i»P¦P¦W¨Æ¥ó´y­z¤£¬Û²Å??
Private Sub ScrollBar1_Change()
Sheets("sheet1").Range("H1").Value = Sheets("sheet1").Range("M2").Value
End Sub

Private Sub Worksheet_Change()
With ScrollBar1
.Max = Sheets("sheet1").Range("H1") + 5
.Min = Sheets("sheet1").Range("H1") - 5
  Sheets("sheet1").Range("H1") = .Value
     End With
End Sub

TOP

¨Æ¥óµ{§Ç«Å§i»P¦P¦W¨Æ¥ó´y­z¤£¬Û²Å??
Private Sub ScrollBar1_Change()
Sheets("sheet1").Range("H1" ...
t8899 µoªí©ó 2014-3-26 06:57

±qµ{¦¡¬Ý¤£¥X¨Ó ScrollBar »P­þ­ÓÀx¦s®æ¦³³s°Ê,
³o¸Ì°²³]¥¦ªº LinkedCell ­È¬° M2. (§Y¨ä­È»P Range("M2") ³s°Ê)

¨º»ò«Øij§A§â Worksheet_Change ¸Ìªº Sheets("sheet1").Range("H1") = .Value ®³±¼, (ScrollBar1_Change ¤w¸g¦³¹F¦¨¦¹¥Øªº¤F)
³o¼ËÂIÀ» ScrollBar ªº¤W¤U¶s,
M2 »P H1 ³£·|¸òµÛ³s°Ê,
ScrollBar ªº Max »P Min ¨â­Ó­È¤]·|¸òµÛÅÜ°Ê,
¤£¹L³o¼Ë¬Ý°_¨Ó©Ç©Çªº. (·Pı³o¼Ëªºµ{¦¡°Ê§@¥i¯à¤£¬O§A·Q­nªº)

«Øij§A§â»Ý¨D¸Ô²Ó´y­z¤@¤U,
©Î¬O´£¨Ñ¬ÛÃöµ{¦¡½X,
³o¼Ë°µ¥X¨Óªºµ{¦¡¸û¯à²Å¦X§Aªº»Ý¨D.

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-3-27 06:46 ½s¿è
±qµ{¦¡¬Ý¤£¥X¨Ó ScrollBar »P­þ­ÓÀx¦s®æ¦³³s°Ê,
³o¸Ì°²³]¥¦ªº LinkedCell ­È¬° M2. (§Y¨ä­È»P Range("M2 ...
luhpro µoªí©ó 2014-3-27 02:54

§Ú·Q­nªº...........
H1Àx¦s®æ===> ¤@¶}©lÂIÀ» ScrollBar ªº¤W¤U¶s¬°100(h1ªº­Èµ¥©óm2) ·Æ°Ê©Ô®ÂÀ³¦b¤¤¶¡
¡A©¹¥ªºÉÀY¬°95, ©¹¥kºÉÀY¬°105 (ªþÀÉ) Book2.rar (6.55 KB)
ÂIÀ»¨ä¥LÀx¦s®æ«á¡Ah1ªº­È¤S¦^¨ìm2ªº­È,©Ô®Â¦^¨ì¤¤¶¡

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2014-3-27 23:04 ½s¿è
¨Æ¥óµ{§Ç«Å§i»P¦P¦W¨Æ¥ó´y­z¤£¬Û²Å??
Private Sub ScrollBar1_Change()
Sheets("sheet1").Range("H1" ...
t8899 µoªí©ó 2014-3-26 06:57

³o¬O¦]¬°§Aªºµ{¦¡¤¤¬O¥Î Private Sub Worksheet_Change()
¦ý¹ê»Ú¤WÀ³¸Ó­nªø³o¼Ë: Private Sub Worksheet_Change(ByVal Target As Range)
³o­Ó¨Æ¥ó³Ì§C­­«×¥²¶·­n´£¨ÑIJµoÅܧó¨Æ¥óªº¥DÅé :Target ³o­Óª«¥ó¥H¨Ñµ{¦¡¹B¥Î,(¤£¯àª½±µ²M±¼)
©Ò¥H·|µo¥Í³o­Ó¿ù»~.

§Ú·Q­nªº...........
t8899 µoªí©ó 2014-3-27 06:42
H1Àx¦s®æ===> ¤@¶}©lÂIÀ» ScrollBar ªº¤W¤U¶s¬°100(h1ªº­Èµ¥©óm2) ·Æ°Ê©Ô®ÂÀ³¦b¤¤¶¡
¡A©¹¥ªºÉÀY¬°95, ©¹¥kºÉÀY¬°105
ÂIÀ»¨ä¥LÀx¦s®æ«á¡Ah1ªº­È¤S¦^¨ìm2ªº­È,©Ô®Â¦^¨ì¤¤¶¡

¬Ý¨ì "ÂIÀ»" ´N­n·Q¨ì SelectionChange (Åܧ󥿳Q¿ï¾Ü<Activate>ªºÀx¦s®æ)
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.   With Target
  3.     Select Case "R" & .Row & "C" & .Column
  4.       Case "R1C8" ' H1
  5.         .Offset(1, 5) = 100
  6.         .Value = .Offset(1, 5)
  7.         With .Parent.ScrollBar1
  8.           .Max = 105
  9.           .Min = 95
  10.           .Value = 100
  11.         End With
  12.       
  13.       Case Else
  14.         With .Parent
  15.           .[H1] = .[M2]
  16.           With .ScrollBar1
  17.             .Max = .Parent.[H1] + 5
  18.             .Min = .Parent.[H1] - 5
  19.             .Value = .Parent.[H1]
  20.           End With
  21.         End With
  22.     End Select
  23.   End With
  24. End Sub
½Æ»s¥N½X
¦Ü©ó¨ä¥Lªºµ{§Ç¥H¤W­zªº»Ý¨D¨Ó¬Ý,
À³¸Ó¼È®ÉÁÙ¤£»Ý­n¥Î¨ì.

TOP

³o¬O¦]¬°§Aªºµ{¦¡¤¤¬O¥Î Private Sub Worksheet_Change()
¦ý¹ê»Ú¤WÀ³¸Ó­nªø³o¼Ë: Private Sub Worksheet ...
luhpro µoªí©ó 2014-3-27 23:02

­èÂI ¥ª¥k h1 ·|µ¥©ó m2 ,¦ý¼W´î­È+-5 ¨S§@¥Î??
Book2.rar (8.66 KB)

TOP

­èÂI ¥ª¥k h1 ·|µ¥©ó m2 ,¦ý¼W´î­È+-5 ¨S§@¥Î??
t8899 µoªí©ó 2014-3-28 07:15

¬Ý¤£À´§Aªº·N«ä.
.Max = .Parent.[H1] + 5
.Min = .Parent.[H1] - 5
´N¬O¦bÅܼW´î­Èªº°Ú.

©Î³\©pÁٻݭn½T»{ ScrollBar ­n»P­þ­ÓÀx¦s®æ°µ³sµ², (H1? ÁÙ¬O M2?)
¤]´N¬O»¡ÂI¤F ScrollBar ªº¥ª¥kÁä«á,
­þ­ÓÀx¦s®æªº¤º®e­n¸òµÛÅÜ?
³oÂI¥u­n³]©w ScrollBar ªº LinkedCell Äݩʬ°¸ÓÀx¦s®æ§Y¥i.

¥t¥~,¦]¦¹¨Ï¨º­ÓÀx¦s®æ­ÈÅܤF«á,
¬O§_¤S¦³Àx¦s®æªº¤º®e­n¸òµÛÅÜ?

TOP

¬Ý¤£À´§Aªº·N«ä.
.Max = .Parent.[H1] + 5
.Min = .Parent.[H1] - 5
´N¬O¦bÅܼW´î­Èªº°Ú.

©Î³\©pÁÙ ...
luhpro µoªí©ó 2014-4-8 21:36

ÁÂÁ¡A§Úªº°ÝÃD¤w¸Ñ¨M¬O­n¥ÎGotFocus
Private Sub ComboBox1_Click()
       [h1].Value = Sheet1.ComboBox1.Text
End Sub
Private Sub ComboBox1_GotFocus()
Sheet1.Range("H1").Value = Sheet1.Range("M2").Value
ComboBox1.List = Sheet1.Range("y30:y38").Value
End Sub

TOP

        ÀR«ä¦Û¦b : ¦a¤WºØ¤Fµæ¡A´N¤£©öªø¯ó¡F¤ß¤¤¦³µ½¡A´N¤£©ö¥Í´c¡C
ªð¦^¦Cªí ¤W¤@¥DÃD