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

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

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

½Ð±Ð¤@¤Uª©¤W¤j¤j¡A¦pªG­n¼g¤@­Ó»ù®æÅÜ°Ê´N°O¿ýªºµ{¦¡­n¦p¦ó¼g??
A2=®É¶¡¡BB2=»ù®æ
¤@¶}©l¥ý±NA2¸òB2¼g¦bA3©MB3¡AµM«á¹ï¤ñB3¸òB2ªº­È¡A¦pªG¤£¬Ûµ¥´N±NA2¡BB2ªº­È¼g¦bA4¡BB4¡A¤@ª½©¹¤U¼g¡A¹³³o¼Ëªºµ{¦¡­n¦p¦ó¼g©O??

¦pªG¥i¥HÁٽЪ©¤W¤j¤j¼g­Ó½d¨ÒÅý§Ú°Ñ¦Ò¡A·PÁÂ

¼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

¦^´_ 3# jackyq


¤j¤j§A¦n¼F®`¡A¥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§Ú¥Î©Ôªº

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

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

¦^´_ 5# jackyq

J¤j¡A¸Ì­±ªº(DDE_Á`¶q)¡A¬O­n¥Î¬Æ»ò´À´«¶Ü¡A§Ú¬Ý¤£¤ÓÀ´¬O¬Æ»ò·N«ä??
¥i¥HÀ°§Ú»¡©ú¤@¤U¶Ü??
§Ú­ìªþ¥ó¸Ì­±¨S¦³³o­ÓªF¦è¡A·PÁ§A³á

´ú¸Õ«á¨S¦³°Ê§@

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

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

¦^´_ 7# jackyq
C¤j§Ú¤F¸Ñ¤F¡A·PÁ©p§Ú¸Õ¸Õ¬Ý
¥i¬O¥Î§Aªºª©¥»§Ú´ú¸Õ¬O¨S¦³°Ê§@ªº

TOP

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

TOP

¦^´_ 9# jackyq

³o­Ó¡A§Ú¬Æ»ò³£¨S§ï
    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

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD