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

[µo°Ý] §Q¥ÎTextbox LinkedCell ¥h°O¿ýtickÁ`¶qÅܤÆ

[µo°Ý] §Q¥ÎTextbox LinkedCell ¥h°O¿ýtickÁ`¶qÅܤÆ

¦³ª¦¤å¨ì¥i¥H§Q¥ÎTextbox ªº onchange¨Æ¥ó¥h°O¿ý¤@ª½Åܤƪºtick­È
¦pªG·Qªk«Ü²³æ A1·|³sµ²¨ìDDEªº¥æ©öÁ`¶q(¤@ª½¸õ°Ê)
´¡¤J¤@­ÓTextbox ¥hLinkedCell A1
¥i¥HA1¤@ÅÜ°Ê ´N°O¿ý¨ìA5,A6,A7...¨Ì§Ç¤@ª½°O¿ý¤U¥h¶Ü?

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-5-4 08:17 ½s¿è

¦^´_ 1# vic
§Ú¼g¤F¤@¤ä´ú¸Õ½d¨Ò¡A¯à¦P®É¨ÓÆ[´ú A1 IJµo
¥H¤Î³sµ² TextBox1 ¼Æ¾ÚÅܤƪº¹ê»Úª¬ºA¡C
´«¥y¸Ü»¡¡A¦b¶}½L«á±Ò°Ê¦¹´ú¸ÕÀɨӶi¦æ
Æ[¹î DDE ¹ê°È¤W¶×¤J¸ê®Æ®É¡A¥¦¨s³º¬O§_·|
IJµo ¡y¤u§@ªí1¡z ªº ¡uWorksheet_Change()¡v
¨Æ¥ó (Event)¡A¦P®É¬O§_¦P¨B±a°Ê ³sµ² A1 Äæ¦ìªº
(LinkedCell) ªº TextBox1 ¤§¡uTextBox1_Change()¡v¡A
¶i¦Ó¯à±q [H1]¡B[I1] ¨â­ÓÄæ¦ì¤¤Æ[¹î¨ì¨ä¼Æ¾ÚÅܰʤ§
¡u¼W¥[­È¡v¬O§_¦P¨B¡C¦pªG¶È¦³ [I1] Ä檺¼Æ¾Ú¦³©Ò¼W¥[¡A
¦Ó [H1] Ä檺¼Æ¾ÚµL¥ô¦ó¡u¼W¥[­È¡v¡A¦¹§Yªí¥Ü DDE
¸ê®Æ¤§¶×¤J¼Æ¾Ú­ÈªºÅܤƨ䣷|²o°Ê¡uWorksheet_Change()¡v
A1 Äæ¦ìÅܤƪº¨Æ¥ó (Event)¡C

¨MªG­È¦p¦ó·Ð½Ð§iª¾¡A¥H«K¶i¤@¨Bª¾±x¸Ó¦p¦ó¶i¦æ¡AÁÂÁ¡I
PS¡G ¦]§Ú¥Ø«e¨S¦³¨Ï¥Î¨é°Ó³nÅé¡C
TestLinkedCell.rar (15.33 KB)
¡C

TOP

¦^´_ 1# vic
¡y¤u§@ªí1¡z¤§µ{¦¡½X¡G
  1. Private Sub TextBox1_Change()
  2.     [I1] = [I1] + 1
  3. End Sub

  4. Private Sub Worksheet_Change(ByVal target As Range)
  5.     If target.Address = "$A$1" Then
  6.         [H1] = [H1] + 1
  7.     End If
  8. End Sub
½Æ»s¥N½X

TOP

§A¦n ·PÁ±zªº¨ó§U
¥Ø«e¥u¦³I1ªº­È·|¤@ª½¥[Á`¤W¥h
¥i¬OH1¤@ª½³£¨S¦³­È





¦^´_ 2# c_c_lai

TOP

¦^´_ 4# vic
¦p¦¹¬Ý¨Ó¡ADDE ¸ê®Æ¤§¶×¤J½T¹ê¤£·|IJµo
Worksheet_Change() (¸Û¦p GBKEE ¤j¤j©Ò¨¥)¡A
©Ò¥H¥u¯àÂǥѹ³¥»½d¨Ò¤§ TextBox1¡A³z¹L¥¦¨Ó
±oª¾¼Æ¾Ú¤§ÅÜ°Ê¡CÁÂÁ§Aªº¹ê°È´ú¸Õ¡I

TOP

§A¦n ·PÁ±zªº¨ó§U
¥Ø«e¥u¦³I1ªº­È·|¤@ª½¥[Á`¤W¥h
¥i¬OH1¤@ª½³£¨S¦³­È





¦^´_  c_c_lai
vic µoªí©ó 2016-5-4 08:57

¥Ñ¹Ï¥Ü¬Ý¥X¤w¸g¶]¤F  584 Ticks ¡A
³o¼Ë«K¯à¦P¨B¼g¤J¨C¤@ Tick ªº¼Æ¾Ú¸ê®Æ¤F¡C
Ä´¦p¡G
  1. Private Sub TextBox1_Change()
  2.     Dim rng As Range
  3.    
  4.     Set rng = [A65535].End(xlUp).Offset(1)
  5.     rng.Resize(, 8) = [A1:H1].Value
  6. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# vic
¦Ò¼{ Ticks ¼Æ¾Ú¶q¤j¡A¥i­×§ï¦¨¡G
  1. Private Sub TextBox1_Change()
  2.     Dim Rng As Range
  3.    
  4.     '  [I1] = [I1] + 1
  5.     '  Set Rng = [A65535].End(xlUp).Offset(1)
  6.     Set Rng = Range("A" & Rows.Count).End(xlUp).Offset(1)     ' Rows.Count =1048576 : Long
  7.     Rng.Resize(, 8) = [A1:H1].Value
  8. End Sub
½Æ»s¥N½X

TOP

«D±`·PÁ §Ú¦A¸ÕµÛ§ï¦¨¥¨¶°ªº§Î¦¡¨Ó°õ¦æ¸Õ¸Õ~


¦^´_ 8# c_c_lai

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