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

[µo°Ý] ¦p¦ó¦bªÑ»ù¹Ï¤U¤èÀ³¥Î VBA ¼W¦C¤@©ÔÅQ¡H

¥»©«³Ì«á¥Ñ alexliou ©ó 2012-5-15 20:38 ½s¿è

¦^´_ 10# c_c_lai
1.¥ÎVBA code ²£¥Íªº ªí³æ±±¨î¶µ ¥¦ªº¦WºÙ¬O¥ÑExcel ¨M©wªº (ex. "¨÷¶b 7")
¬°¤F´x±±³o­Ó±±¨î¶µ, §A³Ì¦n¬OÀ°¥¦­«·s©R¦W
³o¥i§Q¥Î .Name ÄݩʨӹF¦¨
(ex.  .Name = "MyScrollBar1")


2. ³]©w¦¹¤@±±¨î¶µªºEvent Handler
³o¥i§Q¥Î .OnAction ÄݩʨӹF¦¨
(ex.  .OnAction =  "MySrollBar1_Change"

3. ¼¶¼g MyScrollBar1_Change µ{§Çªºµ{¦¡½X

4. ²Ä¤@¨B¥i¬Ù²¤, ¦ý°µ¤F·|¨Ï¤@­P©Ê(±±¨î¶µªº¦WºÙ©M¥¦ªºEvent Handler ¦WºÙ)´£°ª
§A¥i§â .Name = "MyScrollBar1" ¨º¦æ Mark±¼
µ{¦¡¥i¥H¹B§@
¥u¤£¹L "±²¶b x"ªº¨Æ¥ó³B²z¾¹¬O MyScrollBar1_Change
¨âªÌ¦WºÙ¤£¤@­P

5. ScrollBar ¦³¨âºØ  ¥i¥H¬Oªí³æ±±¨î¶µ©Î¬OActive X ±±¨î¶µ
¼Ó¤WGBKEE¤j¤j¦³Demo
¨âªÌ¥ÎVBA Code«Ø¥ß»P³B²z¤èªk¤£¦P
§A¥Îªº¬Oªí³æ±±¨î¶µ

©ÔÅQ¨Æ¥ó²£¥Í¾¹2.zip (11.89 KB)

Alex

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-5-15 16:55 ½s¿è

¦^´_ 10# c_c_lai
³o¸Ì¥i¥H°Ñ¦Ò
§AªþÀɪº¬O ªí³æªºScrollBar
  1. Sub ±²¶b7()    'ªí³æªºScrollBar ¶·«ü©w¥¨¶°
  2.     Dim S As Object
  3.     Set S = ActiveSheet.Shapes(Application.Caller).OLEFormat.Object
  4.     MsgBox S.Name
  5.     MsgBox S.Value
  6.     MsgBox S.Max
  7. End Sub
  8. Sub ±²¶b7A()    'ªí³æªºScrollBar ¶·«ü©w¥¨¶°
  9.     MsgBox ActiveSheet.Shapes(Application.Caller).OLEFormat.Object.Name
  10.     MsgBox ActiveSheet.Shapes(Application.Caller).OLEFormat.Object.Value
  11.     MsgBox ActiveSheet.Shapes(Application.Caller).OLEFormat.Object.Max
  12. End Sub
½Æ»s¥N½X
  1. Private Sub ScrollBar1_Change() '±±¨î¤u¨ã½c ScrollBar1ª«¥óªºµ{§Ç
  2.     MsgBox ScrollBar1.Name
  3.     MsgBox ScrollBar1.Value
  4.     MsgBox ScrollBar1.Max
  5. End Sub
½Æ»s¥N½X
¦p¹Ï


TOP

¦^´_ 8# alexliou
½Ð°Ý¥Ñ VBA ²£¥Íªº ScrollBar ªº Event Handler ¦p¦ó©R¦W¡H ¨Ò¦p¡GPrivate Sub ScrollBar1_Change()  ~  End Sub
¦ý¬O¥[¤J ScrollBar1_Change() «á¨Ã¥¼°_¥ô¦ó§@¥Î¡H À³¸Ó­n¨Ï¥Î Private Sub ScrollBar???_Change()¡H
ªþ¤W´ú¸ÕÀɮסAÁÂÁ«ü±Ð¡I

½Ð±Ð©ÔÅQ¨Æ¥ó²£¥Í¾¹.rar (10.03 KB)

TOP

¦^´_ 8# alexliou
¥H©¹¦b¾³õ®É±`¨Ï¥Î PostgreSQL¥H¤ÎMS SQL¡A»¡¯u®æªº§ÚÁÙ¨S¥Î¹LAcess¡A¦³ªÅ®É§Ú·|¨Ó¸Õ¸Õ¥¦¡A
¥Ø«e§Ú¬O±N¸ê®Æª½±µ¦s©ñ¦bExcelªí³æ¤º°µ´ú¸Õ¡CÂǥѽm²ß¥H¤F¸Ñ VBA ¤Î Excel ªº¸ê®Æ³B²z»PÀ³¥Î¡C
ÁÂÁ±zªºÀ°§U¡A¤µ«á¦p¦³¤£¸Ñ¤§³BÁٻݦA¨Ó¥´ÂZ±z¤F¡I

TOP

¥»©«³Ì«á¥Ñ alexliou ©ó 2012-5-14 20:59 ½s¿è

¦^´_ 6# c_c_lai
¤W¶Çªºµ{¦¡¬O¾ã­Ó§¡½uµ¦²¤¦^´ú¾¹Projectªº¤@³¡¥÷
¥¦ªº¥\¯à¶È³B²zø»sK½u¹Ï

ªÑ»ùªº°ò¥»¸ê®Æ©ñ¦bAccess ¸ê®Æ®w¸Ì    (¤]¬O¾aVBA±qºô¸ô¤WÂ^¨ú¦Ó¨Ó)
¥i¥H®Ú¾Ú¬Y­ÓUserForm ©Î ¬Y¨ÇCellªº¤º®e¨M©w­nLoad
­þ¤@­Ó°Ó«~  ­þ¤@¬q´Á¶¡ªº¸ê®Æ¶i¨Ó
³o¥i¥H¥Î¤@­ÓSub¨Ó³B²z

ªøµu´Á§¡½u¬O®Ú¾Ú°ò¥»¸ê®Æ¨Ó­pºâ
­n¥Î¦h¤Ö¤Ñªº²¾°Ê¥­§¡ ¤]¥i¥H®Ú¾Ú¬Y­ÓUserForm ©Î ¬Y¨ÇCellªº¤º®e¨Ó¨M©w
³o­Ó¨Ò¤l¥Îªº¬O¥|¤é©M¤­¤Q¤é(ÀH«K³]ªº)
²¾°Ê¥­§¡ªº­pºâ¥i¥H¥Î¥t¤@­ÓSub¨Ó³B²z

¶R½æ°T¸¹®Ú¾Ú²¾°Ê¥­§¡½uªºª¬ªp¨Ó¨M©w
¨Ò¦p·íµu´Á§¡½u¤W¬ïªø´Á§¡½u«h²£¥Í"¶R¶i"°T¸¹
¤Ï¤§«h"½æ¥X"
³o¥i¥H¥Î¥t¤@­ÓSub¨Ó³B²z
....
....
....
Alex

TOP

¦^´_ 5# alexliou
§Ú§â DataLabel ¤p§ï¤F¤@¤U¡A®ÄªGÁÙ¤£¿ù¡A½Ð°Ñ¦Ò¡G
  1.             If .DataLabel.Text = "¦h³æ¥­­Ü" Or .DataLabel.Text = "½æ¥XªÅ³æ" Then
  2.                 .DataLabel.Text = .DataLabel.Text & Chr(10) & Format(Cells(i, 5).Value, "###0")      ' ********* ¤p§ï¤F¤@¤U **********
  3.                 ActiveChart.SeriesCollection(4).Points(i - StartKBarRow + 1).MarkerStyle = xlMarkerStyleStar   
  4.                 ActiveChart.SeriesCollection(4).Points(i - StartKBarRow + 1).MarkerSize = 10
  5.                 .DataLabel.position = XlDataLabelPosition.xlLabelPositionBelow
  6.             ElseIf .DataLabel.Text = "ªÅ³æ¥­­Ü" Or .DataLabel.Text = "¶R¶i¦h³æ" Then
  7.                 .DataLabel.Text = .DataLabel.Text & Chr(10) & Format(Cells(i, 5).Value, "###0")      ' ********* ¤p§ï¤F¤@¤U **********
  8.                 ActiveChart.SeriesCollection(4).Points(i - StartKBarRow + 1).MarkerStyle = xlMarkerStyleTriangle
  9.                 ActiveChart.SeriesCollection(4).Points(i - StartKBarRow + 1).MarkerSize = 8
  10.                 .DataLabel.position = XlDataLabelPosition.xlLabelPositionAbove
  11.             End If
½Æ»s¥N½X

TOP

¦^´_ 4# alexliou
Alex ¥S¡A
³\¤[¨SÁpµ¸¤F¡AÁÂÁ±zªº¤À¨É¡A¨ü¯q¨}¦h¡A
¸ÌÀYùئ³¤£¿ùªº³B¸Ì¤èªk¡AÆZ­È±o±´°Qªº¡A
³o¤]¬O§Úªñ¤ë¨Ó¶}©l±µÄ² Excel ¤Î VBA «Ü´ÎªºÁ{§É¹êÅç¡A
¦b¦¹¨¥Á¤F¡I
(½Ð±Ð±z'ªø§¡½u'¬O¦^·¹¦h¤[¡A±z¬O«ç»ò³B¸Ì¼Æ¾Úªº¡H)

TOP

¥t¤@ºØª©¥»
¹Ï°±¯d¦bWorkSheet¤¤
®t§O¦bScroll Event Handler ¤¤¥[¤J¬Y¨ÇÀô¹ÒÅܼƪº³]©w

§¡½uµ¦²¤´ú¸ÕÀô¹Ò2.zip (170.24 KB)

Alex

TOP

¥»©«³Ì«á¥Ñ alexliou ©ó 2012-5-14 14:31 ½s¿è

¦^´_ 3# c_c_lai
»s§@ Scrolling Chart®É
­«ÂI¬O§âScrollBarªºValue ©M¹Ïªíªº¸ê®Æ¨Ó·½ªº¦ì¸m³s¦b¤@°_

·íScrollBar ªºChange¨Æ¥óµo¥Í®É
¹Ïªí´N¥²¶·±N¸ê®Æ¨Ó·½­«³]¤@¦¸

ªþ¥ó¤¤Àɮצ³¤@­Ó§Q¥Îªøµu§¡½u­È¨Ó¨M©w¶R½æ°T¸¹ªºK½u¹Ï,
¨ä¤¤¦³¨â­Ó­«ÂI:
1. ¦]¬°¸ê®Æ¶q«Ü¦h, ³£©ñ¦b¤@±i¹Ï¸Ì·|Åã±o«Ü¾ÖÀ½, ©Ò¥H¤@±i¹Ï¸Ì­­©w¥u©ñ150®ÚK´Î
    K½u¹Ï¤U³]­p¤F¤@­Ó±²¶b, Åý¨Ï¥ÎªÌ¥i¥H±²°Ê±²¶b¨ÓÀ˵ø¤£¦P®É´Áªº¸ê®Æ
2. ·í¦³¶R½æ°T¸¹¥X²{®É, K´Î¤W·|¥X²{"¶R¶i"©Î"½æ¥X"ªº¼ÐÅÒ
    ¦ý·í±²¶b²¾°Ê®É,³o¨Ç¼ÐÅÒ¤]­n¸òµÛ²¾°Ê

§¡½uµ¦²¤´ú¸ÕÀô¹Ò1.zip (155.06 KB)

Alex

TOP

¦^´_ 2# f3202
ÁÂÁ±z¡I
¦]¬°§Úªº¨C±i¹Ïªí³£¬O°ÊºA²£¥Íªº¡A©Ò¥H§Ú¤~·Q¦b¨C­Ó¹Ïªí¤U¤è§¡¦U¦Û°ÊºA°t¸m¤@²Õ©ÔÅQ¡A¦Ó«DÀRºA(¹w¥ý´N¤w¸g²£¥Í)ªº¡A
¤£¹L±z´£¦@ªººô¯¸¤º®e«D±`ªº´Î¡AÁÂÁ±zªº¤À¨É¡I

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD