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

°ïÅ|ªÅ¶¡¤£¨¬??

°ïÅ|ªÅ¶¡¤£¨¬??

Sub RecordPrice()
Dim WR As Long
Dim I As Byte


If Range("E2") < 1 Then Exit Sub

WR = Range("A1").End(xlDown).Row + 1
If (WR = 3) Or _
   ((Second(Range("A2")) Mod 5) = 1) Then 'Á`¶q¦³²§°Ê®É¤~°O¿ý..........................³o­Ó¦a¤è¦³¼g¿ù¶Ü??ÁÙ¬O­n«ç»ò§ï¤ñ¸û¦n??
    Cells(WR, 1).Resize(, 4) = [A2:D2].Value
   End If
End Sub

°õ¦æµ{¦¡«á¬°¤°»ò·|ºÆ¨g¼g¤J¡A¥B¥X²{°ïÅ|ªÅ¶¡¤£¨¬©O??

¦^´_ 1# ÂŤÑÄR¦À
§A¤@©w¬O¦bWorkSheet_Change()¤º©I¥s¸Ó Sub
¾É­P : §ïCell­È > IJµo Change > Call RecordPrice >§ïCell­È > IJµo Change ¡C¡C¡C

«Øij :
WorkSheet_Change  Event«e«á¤À§O¥[¤W¡AÁקK¤º³¡¦æ¬°¦A¦¸Ä²µo¸ÓEvent
Application.EnableEvents = False
...
Application.EnableEvents = True
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 1# ÂŤÑÄR¦À
  1. WR = Range("A1").End(xlDown).Row + 1
½Æ»s¥N½X
½Ð§ï¦¨
  1. WR = Range("A" & Rows.Count).End(xlUp).Row + 1
½Æ»s¥N½X
¸Õ¸Õ¬Ý¡C

TOP

¦^´_ 2# stillfish00
S¤j§A¦n¤p§Ì¦³¨â­ÓºÃ°Ý¸ò§A½Ð±Ð¤@¤U

1.§Úµ{¦¡¸Ì­±¨S¦³WorkSheet_Change()¡A
¦ý¦³Private Sub Worksheet_Calculate()
        Application.EnableEvents = False.............©Ò¥H¬O¥[¦b³oÃä
        Call RecordPrice
        Application.EnableEvents = True..............ÁÙ¦³³oÃä¶Ü??
        End Sub

2.S¤jÁÙ¨S»¡¤§«e§Ú¬O¥[¦b
Sub RecordPrice()
Dim WR As Long
Dim I As Byte


If Range("E2") < 1 Then Exit Sub

WR = Range("A1").End(xlDown).Row + 1
If (WR = 3) Or _
   ((Second(Range("A2")) Mod 5) = 1) Then
    Application.EnableEvents = False.................³oÃä
    Cells(WR, 1).Resize(, 4) = [A2:D2].Value
   Application.EnableEvents = True...................ÁÙ¦³³oÃä
   End If
End Sub

§Ú¥[§¹«á´N¥i¥H°õ¦æ¤F¡A½Ð±ÐS¤j§Ú²Ä¤@­Ó®aªº¦a¤è¹ï¶Ü??¦pªG¹ï¡A¨º¸ò²Ä¤G­Ó¥[ªº¦a¤è°õ¦æ°_¨Ó·|¦³¤°»ò¤£¦P©O?

TOP

¦^´_ 3# c_c_lai

C¤j´ú¸Õ«á¤@¼Ë°ïÅ|ªÅ¶¡¤£¨¬¡A§Ú¬Q¤Ñ¬O¥Î2#ªº¤èªk¡A¥ÎApplication.EnableEvents¥h¸Ñ¨Mªº¡A¦ý¬O¹ï©ó¥[¦b¨º¸Ì¤£¬O«Ü²M·¡¡AC¤j¥i¥H¬Ý¬Ý4#¦Aµ¹§Ú¤@¨Ç·N¨£

TOP

¦^´_ 5# ÂŤÑÄR¦À
§AÀ³¸Ó½Ð±Ð stillfish00 ¤j¤jªº¡C
  1. Sub RecordPrice()
  2.     Dim WR As Long
  3.     Dim I As Byte

  4.     If Range("E2") < 1 Then Exit Sub
  5.     Application.EnableEvents = False
  6.     .
  7.     .
  8.     .
  9.     Application.EnableEvents = True
  10. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# c_c_lai

C¤j§Ú¤]¦³½Ð±Ð¥L¡A¥t¥~
Private Sub Worksheet_Calculate()
        Application.EnableEvents = False.............©Ò¥H¬O¥[¦b³oÃä
        Call RecordPrice
        Application.EnableEvents = True..............ÁÙ¦³³oÃä¶Ü??
        End Sub
..............................................................................................................................................................................

Sub RecordPrice()
Dim WR As Long
Dim I As Byte


If Range("E2") < 1 Then Exit Sub

WR = Range("A1").End(xlDown).Row + 1
If (WR = 3) Or _
   ((Second(Range("A2")) Mod 5) = 1) Then
    Application.EnableEvents = False.................³oÃä
    Cells(WR, 1).Resize(, 4) = [A2:D2].Value
   Application.EnableEvents = True...................ÁÙ¦³³oÃä
   End If
End Sub

¥[¦b¤W­±³o¨â­Ó¦a¤è¦³¬Æ»ò¤£¦P??

TOP

¦^´_ 7# ÂŤÑÄR¦À
§A¦Û¤v¥ý´ú¸ÕÆ[¹î¦³¦ó®t²§¡H
µª®×¬O¤@¼Ëªº¡C
®t§O¶È¦b©ó§A¬~¾þ®É±N´«¬~¦çªA©ñ¦bª×«Ç»P¨Æ¥ý®³¶i¯D«Ç
¦³¦ó®t§O¡H

TOP

¦^´_ 8# c_c_lai


    C¤j§Ú¤F¸Ñ¤F

TOP

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Call RecordPrice
Application.EnableEvents = True
End Sub

¦³¤H¶i±Ð«Ç®É
¥þÅé°_¥ß
·q§
¥þÅ駤¤U
================================
Private Sub Worksheet_Calculate()
If ±ø¥ó§PÂ_ = True Then
¡@Application.EnableEvents = False
¡@Call RecordPrice
¡@Application.EnableEvents = True
End If
¦³¤H¶i±Ð«Ç®É
¦pªG¶i¨Óªº¬O¦Ñ®v
¥þÅé°_¥ß
·q§
¥þÅ駤¤U
End Sub

°²³]¶i¨Óªº¦³¢°¢¯¢¯­Ó¤H¦¸¡A¦Ó¦Ñ®v¥u¦³¢´¤H¡A¸Õ·Q¬Ý¬Ý¨âºØª¬ªp®t§O¦h¤Ö¡H¡H¡H¡@
¡@
¡@

TOP

        ÀR«ä¦Û¦b : ­n¤ñ½Ö§ó¨ü½Ö¡D¤£­n¤ñ½Ö§ó©È½Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD