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

DDE°O¿ý¦p¦ó½Æ»s¦b¤£¦P¤u§@ªí

DDE°O¿ý¦p¦ó½Æ»s¦b¤£¦P¤u§@ªí

¬Ý¤F³o½gDDE¼Æ¾Ú¨C¤ÀÄÁ¬ö¿ý¤U¨Ó¹ï©ó­è±µÄ²VBA¤£À´ªº§Úı±o«D±`¹ê¥Î
¹ï©ó¦p¦ó­n°O¿ý ¤Þ¥ÎGBKEE¤j¤jªº³o¥y 'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m °²¦p³o¬O°O¿ý¥x«ü´ÁªºDDE ¨Ã¦P®É¤]­n°O¿ý¹q¤l´Á»Pª÷¿Ä´ÁªºDDE¦b¤£¦P
ªº¤u§@ªí¦pSheet5(¹q¤l´Á)»PSheet6(ª÷¿Ä´Á) ¤£À´ªº§Ú¸ÕµÛ·Ó§Û ÁÙ¬O¤£¦æ½Ð±ÐÀ³¸Ó¦p¦ó°µ ¥H¤U¬O¤Þ¥ÎGBKEE¤j¤jªºVBA ¨Ã¥[¤J§Ú¿ù»~ªº¤èªk
  1. Private Sub Workbook_Open()
  2. If Time >= TimeValue("08:45:00") And Time <= TimeValue("13:45:00") Then
  3. Sheet2.[B7:G307] = ""
  4. change
  5. Else
  6. Application.OnTime "09:01:00", "ThisWorkbook.change"
  7. End If
  8. End Sub
  9. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  10. Private Sub change()
  11.     Dim TimeRange As Range, Rng As Range, R As Range
  12.     With Sheet2
  13.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  14.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  15.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 2))
  16.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  17.          With Sheet5 '¹q¤l´Á§Ú¥[¤Jªº³¡¤À
  18.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  19.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  20.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 3))
  21.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  22.          With Sheet6 'ª÷¿Ä´Á§Ú¥[¤Jªº³¡¤À
  23.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  24.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  25.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 4))
  26.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  27.     End With
  28.     End With
  29.     End With
  30.     Rng.Value = R.Offset(, 1).Resize(, 6).Value
  31.     If Time > TimeValue("13:45:00") Then Exit Sub
  32.     Application.OnTime Now + TimeValue("00:01"), "ThisWorkbook.change"
  33. End Sub
½Æ»s¥N½X
¥u·|°O¿ý³Ì«á¤@­ÓSheet6 ½Ð¤j¤j«ü¾É¸Ó¦p¦ó¥[¤J ÁÂÁÂ

¦^´_ 1# jerrystock
À°§A¦h¥[¤G¥y    §A¬O­n¦p¦¹¶Ü?
  1. Private Sub Workbook_Open()
  2. If Time >= TimeValue("08:45:00") And Time <= TimeValue("13:45:00") Then
  3. Sheet2.[B7:G307] = ""
  4. change
  5. Else
  6. Application.OnTime "09:01:00", "ThisWorkbook.change"
  7. End If
  8. End Sub
  9. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  10. Private Sub change()
  11.     Dim TimeRange As Range, Rng As Range, R As Range
  12.     With Sheet2
  13.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  14.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  15.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 2))
  16.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  17.        Rng.Value = R.Offset(, 1).Resize(, 6).Value                         ' ***³o¸Ì¤]­n: Rªº¼Æ¾Ú «ü©w¨ì Rng
  18.   With Sheet5 '¹q¤l´Á§Ú¥[¤Jªº³¡¤À
  19.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  20.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  21.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 3))
  22.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  23.          Rng.Value = R.Offset(, 1).Resize(, 6).Value                         ' ****Sheet6ªº ³o¸Ì¤]­n: Rªº¼Æ¾Ú «ü©w¨ì Rng
  24.          With Sheet6 'ª÷¿Ä´Á§Ú¥[¤Jªº³¡¤À
  25.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  26.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  27.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 4))
  28.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  29.          Rng.Value = R.Offset(, 1).Resize(, 6).Value                        'Rªº¼Æ¾Ú «ü©w¨ì Sheet6ªº Rng
  30.     End With
  31.     End With
  32.     End With
  33.        If Time > TimeValue("13:45:00") Then Exit Sub
  34.     Application.OnTime Now + TimeValue("00:01"), "ThisWorkbook.change"
  35. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ jerrystock ©ó 2012-2-18 01:04 ½s¿è

¦^´_ 2# GBKEE
«D±`·PÁÂGBKEE¤j¤jªº«ü¾É  ¥i¥H°O¿ý¤F  ·P®¦^^

TOP

¤£¦n·N«ä¥i¥H½Ð°Ý¦pªG¼Æ¾Ú¤@ª½©¹¤U°O¿ý ¥i¥H¤£¥Î©Ô±²¶b¬Ý³Ì¤U¤è¼Æ¾Ú  
¯àÅý¼Æ¾Ú©¹¤U°O¿ý±²¶b¸òµÛ©¹¤U²¾°Ê  ´N¥i¥H¬Ý¨ì³Ì·s°O¿ý¦Ó¤£¥Î©Ô±²¶b¶Ü?

TOP

¦^´_ 4# jerrystock
  1. Private Sub change()
  2.     Dim TimeRange As Range, Rng As Range, R As Range
  3.     With Sheet2
  4.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  5.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  6.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 2))
  7.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  8.         Rng.Value = R.Offset(, 1).Resize(, 6).Value                         ' ***³o¸Ì¤]­n: Rªº¼Æ¾Ú «ü©w¨ì Rng
  9.         .Activate
  10.         Rng.Select
  11.         With Sheet5 '¹q¤l´Á§Ú¥[¤Jªº³¡¤À
  12.             Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  13.             Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  14.             Set R = Application.Evaluate(Mid(.Range("A3").Formula, 3))
  15.             'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  16.             Rng.Value = R.Offset(, 1).Resize(, 6).Value                         ' ****Sheet6ªº ³o¸Ì¤]­n: Rªº¼Æ¾Ú «ü©w¨ì Rng
  17.             .Activate
  18.             Rng.Select
  19.             With Sheet6 'ª÷¿Ä´Á§Ú¥[¤Jªº³¡¤À
  20.                 Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  21.                 Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  22.                 Set R = Application.Evaluate(Mid(.Range("A3").Formula, 4))
  23.                 'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  24.                 Rng.Value = R.Offset(, 1).Resize(, 6).Value                        'Rªº¼Æ¾Ú «ü©w¨ì Sheet6ªº Rng
  25.                 .Activate
  26.                 Rng.Select
  27.             End With
  28.         End With
  29.     End With
  30.     If Time > TimeValue("13:45:00") Then Exit Sub
  31.     Application.OnTime Now + TimeValue("00:01"), "ThisWorkbook.change"
  32. End Sub
½Æ»s¥N½X

TOP

¤µ¤Ñ¶}½L´ú¸Õ¯uªº¥i¥H ¦n°ª¿³ !!
¹ê¦b«Ü¨ØªAGBKEE¤j¤j ­±¹ï¨º»ò¦hºÃÃøÂø¯g³£Ãø¤£­Ë¥L¥B¦^Âгt«×¤§§Ö  ¯uªº«Ü¦³¤~µØ
¦b¦¹»¡Án«D·PÁ±z^^

TOP

¤£¦n·N«ä¤S¦A¦¸³Â·Ð¤j¤j ¦pªG§Ú·Q¦bSheet6°Ñ·ÓSheet2¶}½L»ù»P¦¬½L»ù2Äæ¦ì°µÆ[¹î
§Æ±æSheet6¸òµÛSheet2ÅÜ°Ê ¯àÅý¼Æ¾Ú©¹¤U°O¿ý±²¶b¸òµÛ©¹¤U²¾°Ê  
´N¥i¥H¬Ý¨ì³Ì·s°O¿ý¦Ó¤£¥Î©Ô±²¶b  
§Æ±æ¤j¤j¦A¦¸«ü¾É  ÁÂÁÂ!!
  1. Private Sub change()
  2.     Dim TimeRange As Range, Rng As Range, R As Range
  3.     With Sheet2
  4.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  5.         Set Rng = TimeRange.Offset(, 1).Resize(1, 6)
  6.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 2))
  7.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  8.         Rng.Value = R.Offset(, 1).Resize(, 6).Value
  9. With Sheet6  '©T©w¦bSheet6Æ[¹îShee2¼Æ­ÓÄæ¦ì
  10.      .Activate
  11.       Rng.Select
  12. End With
  13. End With
  14.     If Time > TimeValue("13:45:00") Then Exit Sub
  15.     Application.OnTime Now + TimeValue("00:01"), "ThisWorkbook.change"
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_ 7# jerrystock
  1. Option Explicit
  2. Private Sub Worksheet_Calculate()  'Sheet6¼Ò²Õªº­«ºâ¨Æ¥ó
  3.     '»Ý¥ý¦bSheet6 ¼g¤W¤½¦¡
  4.     '¦p A2=Sheet2!A1   Sheet2ªº¶}½L»ù
  5.     '¦p B2=Sheet2!B1   Sheet2ªº¦¬½L»ù
  6.     '¼Æ¾Ú±qA4©¹¤U°O¿ý  ¨Ò:A4 ="¦¬½L»ù"
  7.     With Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(1, 2)
  8.         .Value = [A2].Resize(, 2).Value
  9.         .Select
  10.     End With
  11. End Sub
½Æ»s¥N½X

TOP

½Ð¤j¤jÀ°§Ú¬Ý¤@¤U §Ú¥Î³o¼Ë¦n¹³¤£¹ï §Ú¦³¸Õ¹L²¾¨Ó²¾¥h¨S·§©À¤£ª¾©ñ¦b­þ¸Ì ¦ýSheet6§Ú¦³¥[
¤½¦¡ µM«áSheet6Àx¦s®æ¦³©¹¤U©Ô¨ìSheet2!B307  ³Â·Ð¤j¤j¤F ÁÂÁÂ
  1. Private Sub Workbook_Open()
  2. If Time >= TimeValue("08:45:00") And Time <= TimeValue("13:45:00") Then
  3. Sheet2.[B7:G307] = ""
  4. change
  5. Else
  6. Application.OnTime "09:01:00", "ThisWorkbook.change"
  7. End If
  8. End Sub
  9. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  10. Private Sub change()
  11.     Dim TimeRange As Range, Rng As Range, R As Range
  12.     With Sheet2
  13.         Set TimeRange = .[A:A].Find(Format(TimeSerial(Hour(Time), Minute(Time), 0), "hh:mm"), LookIn:=xlValues)
  14.         Set Rng = TimeRange.Offset(, 1).Resize(1, 50)
  15.         Set R = Application.Evaluate(Mid(.Range("A3").Formula, 2))
  16.         'R ¬OA3ªº¤½¦¡ =Data!B2 ©Ò«üªº¦ì¸m
  17. End With
  18.     Rng.Value = R.Offset(, 1).Resize(, 50).Value
  19.     If Time > TimeValue("13:45:00") Then Exit Sub
  20.     Application.OnTime Now + TimeValue("00:01"), "ThisWorkbook.change"
  21. End Sub

  22.     Option Explicit
  23.     Private Sub Worksheet_Calculate()  'Sheet6¼Ò²Õªº­«ºâ¨Æ¥ó
  24.         '»Ý¥ý¦bSheet6 ¼g¤W¤½¦¡ ¤w¼g¤W¤½¦¡
  25.         '³o¸Ì¦³¥[¤FA7=Sheet2!B7©¹¤U©Ô   Sheet2ªº¶}½L»ù
  26.         '³o¸Ì¦³¥[¤FB7=Sheet2!C7©¹¤U©Ô   Sheet2ªº¦¬½L»ù
  27.         '¼Æ¾Ú±qA4©¹¤U°O¿ý  ¨Ò:A4 ="¦¬½L»ù"
  28.         With Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(1, 18)
  29.             .Value = [A2].Resize(, 18).Value
  30.             .Select
  31.         End With
  32.     End Sub
½Æ»s¥N½X

TOP

¦^´_ 9# jerrystock
Private Sub Worksheet_Calculate()  'Sheet6¼Ò²Õªº­«ºâ¨Æ¥ó
§A¬O½Æ»s¦bSheet6¼Ò²Õ¤º¶Ü? ¦pªG¬O ÁÙ¦³ºÃ°Ý ½ÐªþÀÉ¨Ó¬Ý¬Ý .

TOP

        ÀR«ä¦Û¦b : ·R¤£¬O­n¨D¹ï¤è¡A¦Ó¬O­n¥Ñ¦Û¨­ªº¥I¥X¡C
ªð¦^¦Cªí ¤W¤@¥DÃD