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

Åܰʬö¿ýªºµ{¦¡

¼gªk´N©M¤j¤jªº³o½g http://forum.twbts.com/thread-16677-1-1.html  ¤@¼Ë

¥u¬O§A¸Ì­±¦³¤@¬q¼g¿ù

(Range("B" & WR - 1) <> Range("B2")) Then 'Á`¶q¦³²§°Ê®É¤~°O¿ý

(Range("B" & (WR - 1)) <> Range("B2")) Then

TOP

§c,  §Ú·d¯QÀs¤F
³o¼Ë¤~¹ï

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


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

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


'For I = 1 To 10
'   Cells(WR, I) = Cells(2, I)
'Next 'I
End Sub

TOP

¤£¤£, §Ú¤£¼F®`, ³o­Ó¨ä¥L¤j¤j³£ª¾¹D, ¥L­Ì¦£¦Ó¤w


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

Excel.Application.EnableEvents = 0

Dim DDE_Á`¶q As Range
Set DDE_Á`¶q = Range("D2")
   
If IsError(DDE_Á`¶q.Value) Then Exit Sub
If DDE_Á`¶q.Value <= 0 Then Exit Sub

WR = DDE_Á`¶q.CurrentRegion.Row + DDE_Á`¶q.CurrentRegion.Rows.Count
'ActiveWindow.ScrollRow = WR - 5 '¥uÅã¥Ü³Ì·s´Xµ§¸ê®Æ
If (WR = 3) Or _
   (Cells(WR - 1, DDE_Á`¶q.Column) <> DDE_Á`¶q.Value) Then       'Á`¶q¦³²§°Ê®É¤~°O¿ý
    Cells(WR, DDE_Á`¶q.Column).Offset(, -1).Resize(, 3).Value = _
                      DDE_Á`¶q.Offset(, -1).Resize(, 3).Value
End If

Excel.Application.EnableEvents = 1
End Sub

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-3-22 08:41 ½s¿è

¦]¬°§A»¡§A­n´«¦ì¸m£«
­ì¥»Á`¶qªº DDE ¦b  B2 ¨º´N¼g¦¨ Set DDE_Á`¶q = Range("B2")
¦pªGÁ`¶qªº DDE ·h¨ì  D2 ¨º´N¼g¦¨ Set DDE_Á`¶q = Range("D2")
¨ä¥Lªº³£¤£¥Î§ï
¦pªG°í«ù¥Î­ì¥ý¨º­Ó
¨C¦¸´«¦ì¸m´N­n­×§ï¤£¤Ö¦a¤è


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


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

Excel.Application.EnableEvents = 0

WR = Range("C1").End(xlDown).Row + 1
'ActiveWindow.ScrollRow = WR - 5 '¥uÅã¥Ü³Ì·s´Xµ§¸ê®Æ
If (WR = 3) Or _
   (Range("D" & WR - 1) <> Range("D2")) Then 'Á`¶q¦³²§°Ê®É¤~°O¿ý
    For I = 3 To 5
    Cells(WR, I) = Cells(2, I)
    Next
End If


Excel.Application.EnableEvents = 1

'For I = 1 To 10
'   Cells(WR, I) = Cells(2, I)
'Next 'I
End Sub

TOP

­þ­Óª©¥»? ..............

TOP

¦³¥i¯à°õ¦æ¨ì Excel.Application.EnableEvents = 0 ®É
ÁÙ¨S°õ¦æ¨ì Excel.Application.EnableEvents = 1 ´N¨©§A¤¤³~ Stop ±¼
¨º§Aªº¨Æ¥ó´N¤£·|¦bIJµo
OR ¨ä¥L­ì¦].... ¨SÀɮרS¯u¬Û

TOP

§ï¦¨³o¼Ë

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

Dim DDE_Á`¶q As Range
Set DDE_Á`¶q = Range("D2")
   
If IsError(DDE_Á`¶q.Value) Then Exit Sub
If DDE_Á`¶q.Value <= 0 Then Exit Sub

WR = DDE_Á`¶q.CurrentRegion.Row + DDE_Á`¶q.CurrentRegion.Rows.Count
'ActiveWindow.ScrollRow = WR - 5 '¥uÅã¥Ü³Ì·s´Xµ§¸ê®Æ
If (WR = 3) Or _
   (Cells(WR - 1, DDE_Á`¶q.Column) <> DDE_Á`¶q.Value) Then       'Á`¶q¦³²§°Ê®É¤~°O¿ý

    Excel.Application.EnableEvents = 0

    Cells(WR, DDE_Á`¶q.Column).Offset(, -1).Resize(, 3).Value = _
                      DDE_Á`¶q.Offset(, -1).Resize(, 3).Value

    Excel.Application.EnableEvents = 1
End If

End Sub

TOP

¦sÀÉ«á ÀÉ®×°O±oÃö³¬¦b­«¶}

TOP

¦^´_ 15# ÂŤÑÄR¦À


    §AªºÀɮ׸̭±ªº    ThisWorkBook

Private Sub Workbook_Open()
Application.RTD.ThrottleInterval = 0
''   Application.Calculation = xlCalculationManual     -> §â³o­Ó¾B¸n±¼«á, ¦sÀɦA­«¶}
End Sub

TOP

123_b.zip (215.37 KB)

TOP

        ÀR«ä¦Û¦b : ¯à¥I¥X·R¤ß´N¬OºÖ¡A¯à®ø°£·Ð´o´N¬O¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD