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

»ù®æ¬ö¿ýªº»yªk¦³¼g¿ù¶Ü??

»ù®æ¬ö¿ýªº»yªk¦³¼g¿ù¶Ü??

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2016-3-17 23:24 ½s¿è

°£¿ù.rar (36.73 KB)
½Ð°Ýª©¤W¤j¤j¡A§Ú¤W¶Çªºªþ¥ó¬O¤@­Ó»ù®æÅÜ°Ê´N°O¿ýªºVBA¡A¦ý¬O§Ú¦b°õ¦æªþ¥ó¸Ì­±ªºMacro1®É¡AÀ³¸Ó¸ê®Æ·|§R±¼¡A¥i¬O°õ¦æ§¹«á¤£¦ý¤£·|§R±¼¡AÁÙ·|°¨¤W¥X²{«Ü¦h¤@¼Ëªº¸ê®Æ¡A½Ðª©¤W¤j¤jÀ°§Ú¬Ý¬Ý³o­Ó»yªk¦³¬Æ»ò°ÝÃD¶Ü??

§Úµo²{§â®ÇÃ䪺¤½¦¡§R±¼´N¥¿±`¤F¡A³o¬O¤°»ò­ì¦]??¥i¥H­×§ï¦¨»ù®æÅÜ°Ê´N¬ö¿ý¥B¦P®É«O¦³®ÇÃ䪺¤½¦¡¶Ü??


DDE¦pªG¨S¦³¥i¥H¥ÎÀH«Kªº¼Æ¦r¤U¥h´ú¸Õ

http://forum.twbts.com/viewthread.php?tid=15062&highlight=

¥Î Worksheet_Calculate ¨Æ¥ó¡I
¬O¥i¥H¡A¦ý¦Ò¼{¼h­±¸û¦h¡A¨Ò¦p·|²£¥Í¡e³sÂêIJ°Ê¡f¡A­n¤£¬O¦P¤@µ§¤º®e°O¿ý¦¨«Ü¦hµ§¡A
¤£µM¾ã­ÓÀÉ®×´N±¾±¼¡A±z¥²¶·¥h±±¨î¨Æ¥óµo¥Íªº®É¾÷¡A¦b¤U¸üªþÀɤ¤¦³­Ó¨Ò¤l¡A¥i°Ñ¦Ò¡I

TOP

¦^´_ 2# ­ã´£³¡ªL


    ¤j¤jÁÂÁ§Aªº¦n·N¡A¦ý§Ú¤£·|¼g¡A¥u·|²³æªº­×§ï¡A¨S¦³½d¨Ò´N¨S¿ìªk¤F¡A¤£¹LÁÙ¬OÁÂÁ§A

TOP

¦^´_ 1# ÂŤÑÄR¦À
§ï¥Î Change ¸Õ¸Õ¬Ý¡I
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     If Target.Address = "$B$2" Then Call RecordPrice
  3. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# c_c_lai
¦n¡AÁÂÁÂC¤j

TOP

¦^´_ 4# c_c_lai

C¤j½Ð±Ð¤@¤U³o¬qµ{¦¡½X­n¥[¦b­þ¸Ì??

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-3-22 06:53 ½s¿è

¦^´_ 6# ÂŤÑÄR¦À
¨ú¥N§A­ì¥ý Sheets("RTD") ¸Ìªº Worksheet_Calculate()¡C
¤S¡A§A ¥Ø«e "¼Ò²Õ1" RecordPrice ¸Ìªº For ~ Next ¹Bºâ¦¡¥i¥H
¥Î¤U¦C¤è¦¡¨ú¥N¡A¥H¸`¬Ù³B¸Ì®É¶¡¡G
  1.    '  For I = 1 To 3
  2.    '      Cells(WR, I) = Cells(2, I)
  3.    '  Next I
  4.    Cells(WR, 1).Resize(, 3) = [A2:C2].Value
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2016-3-22 08:32 ½s¿è

¦^´_ 7# c_c_lai


  1.  C¤j§Ú¤£¤ÓÀ´¡A¬°¤°»ò¦h¤FCells(WR, 1).Resize(, 3) = [A2:C2].Value³o¤@¦æµ{¦¡½X°õ¦æ¼Æ«×·|¥[§Ö??

2.¥t¥~¦A½Ð±Ð§A¤@­Ó°ÝÃD¡A¦pªG¥Ø«e¬O±NA2-C2ªº¸ê®Æ©¹¤U¼g¡A§ï¦¨§â¸ê®Æ©ñ¦bC2-E2µM«á©¹¤U¼g­n«ç»ò§ïµ{¦¡½X??
´N¬O±N¹Ï¤@§ï¦¨¹Ï¤G¡A¤W¹Ï¤£¬O§ï¦nªº¡A¬O§Ú¥Î©Ôªº

3.¥H¤U¬OJ¤j¼gªº¡A½Ð±ÐC¤j¥ÎExcel.Application.EnableEvents ¸ò§Aªº¥Îchange­þºØ¤ñ¸û§Ö??
Excel.Application.EnableEvents = 0
WR = Range("A1").End(xlDown).Row + 1
'ActiveWindow.ScrollRow = WR - 5 '¥uÅã¥Ü³Ì·s´Xµ§¸ê®Æ
If (WR = 3) Or _
   (Range("B" & WR - 1) <> Range("B2")) Then 'Á`¶q¦³²§°Ê®É¤~°O¿ý
    For I = 1 To 3
    Cells(WR, I) = Cells(2, I)
    Next
End If
Excel.Application.EnableEvents = 1

TOP

¦^´_ 8# ÂŤÑÄR¦À
¥ý¦^µª§A²Ä¤@­Ó°ÝÃD¡G
  1. If (WR = 3) Or _
  2.     (Range("B" & WR - 1) <> Range("B2")) Then ' Á`¶q¦³²§°Ê®É¤~°O¿ý
  3.      For I = 1 To 3
  4.          Cells(WR, I) = Cells(2, I)
  5.      Next
  6. End If
½Æ»s¥N½X
±q For ~ Next §ï¬°¤U¦C¤@¦¸¥\¤Ò´N¶ñ¤J­È (Assign Value) ªº¤è¦¡¡A
§A»¡¬O­þ­Ó³B²z¸û§Ö³t¡H
  1. If (WR = 3) Or _
  2.     (Range("B" & WR - 1) <> Range("B2")) Then ' Á`¶q¦³²§°Ê®É¤~°O¿ý
  3.     Cells(WR, 1).Resize(, 3) = [A2:C2].Value
  4. End If
½Æ»s¥N½X

TOP

¦^´_ 9# c_c_lai


    C¤j§Ú·|¿ù·N¤F¡A­è­è¨S¬Ý¨ì§A«e­±¦³ '¡A§âµ{¦¡mark±¼©Ò¥H§Ú¤~ı±o©_©Ç¡A¬Ý¨ì«á´N¨S°ÝÃD¤F

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡µLªk¾B¾×¡j©È®É¶¡®ø³u¡Aªá¤F³\¦h¤ß¦å¡A·QºÉ¦U¦¡¤èªk­n¾B¾×®É¶¡¡Aµ²ªG¬O¡G®ö¶O¤F§ó¦h®É¶¡¡A¥B¤@µL©Ò¦¨¡I
ªð¦^¦Cªí ¤W¤@¥DÃD