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

[µo°Ý] ¦p¦ó§Q¥ÎVBA¦^¶Ç¤å¦r?

¥»©«³Ì«á¥Ñ leehom ©ó 2015-9-16 13:11 ½s¿è

Workbook.zip (27.66 KB)


¦^´_ 6# GBKEE




·PÁ¶W¯Åª©¥Dªº¦^ÂаڡA§Ú¸Õ¹L¬O¦³®Äªº¡A¦ý§Ú·Q±N¥N½X¤Þ¤J³o­Ó¤u§@ªí«oµLªk¦¨¥\¡A
§Ú¤§«e½Ð±Ð¤F¨ä¥L°ª¤H¡A¼g¤F¤@¨ÇVBA¥N½X¡A¤@¶}±Òªº¸Ü·|¼u¥Xµøµ¡­n¨D¿é¤J¸¹½X¡A
¤å¦r¼Ò¦¡¬OABCD0123456¡AµM«á¿é¤J¼W¥[¦h¤Ö­Ó¡A¥¦·|¦Û°Ê»¼¼W¡A¹³¹Ï¤W¨º¼Ë¡A
§Úªº­ì·N¬O§Æ±æ¬OAÄæ"QTY"·|¦Û°Ê²K¥[¸¹½XµM«á¶¶À³»¼¼W¡A¦ý«oµLªk¦¨¥\¡A
¥u¦n¦A½Ð¨D¦U¦ì°ª¤â¤F¡AÁÂÁ°ڡI¡I

TOP

¦ý¤U©Ô»¼¼W´N¤£¦æ¤F,¬°¬Æ»ò·|³o¼Ë©O®v¥S?
leehom µoªí©ó 2015/9/15 23:39

³o¼Ë´N¥i¥H.
  1. Option Explicit
  2. Private Sub Worksheet_Change(ByVal Target As Range)
  3.     Dim E As Range
  4.     If Target.Column = 2 Then
  5.         For Each E In Target
  6.             If E = "" Then
  7.                 E.Offset(, -1) = ""
  8.             Else
  9.                 E.Offset(, -1) = E & " " & E.Row
  10.             End If
  11.         Next
  12.     End If
  13. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# lpk187

ªº½T«Ü¯«©_,§Úµo²{¿é¤J¤å¦r¬O¦¨¥\ªº,¦ý¤U©Ô»¼¼W´N¤£¦æ¤F,¬°¬Æ»ò·|³o¼Ë©O®v¥S?

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-9-15 22:34 ½s¿è

¦^´_ 3# leehom


    ¨Ì·Ó§A¶Ç¦^¼Æ¦r¡A¥i¥H§Q¥ÎTargetªº¦C¸¹(Row)¦^¶Ç
IJµo«h§ï¬°²Ä¤GÄæColumn = 2 ¡A¤]´N¬OBÄæ
  1. Private Sub Worksheet_Change(ByVal Target As Range)

  2. If Target.Column = 2 Then
  3.     If Target = "" Then
  4.         Target.Offset(, -1) = ""
  5.     Else
  6.         Target.Offset(, -1) = Target & " " & Target.Row
  7.     End If
  8. End If
  9. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ leehom ©ó 2015-9-15 21:48 ½s¿è

¦^´_ 2# lpk187


ªGµM¦³¥Î°Ú,ÁÂÁ°Ú!!ÁÙ·Q¦A½Ð±Ð¤@¤U,¦pªG·Q¦^¶Çªº¬O¼Æ¦r,¦p¦ó³]©w»¼¼W?
¨Ò¦pB1¿é¤J¤å¦r,A1¦^¶Ç¬O"1",B2¿é¤J¤å¦r,A2¦^¶Ç¬O"2",B3¿é¤J¤å¦r,A3¦^¶Ç¬O"3",
¦p¦¹Ãþ±À,­n¦p¦ó½s¼g©O?ÁÂÁ®v¥S«ü±Ð!!!:D

TOP

¦^´_ 1# leehom


    ¤£ª¾¹D§A©Ò¿×ªº¯S©w¤å¦r¬O¤°»ò¡H
¤£¹L§A¥i¥H§Q¥Î¤u§@ªí¨Æ¥ó¨Ó»s§@
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. If Target.Address = "$B$1" Then
  3.     If Target = "" Then
  4.         Target.Offset(, -1) = ""
  5.     Else
  6.         Target.Offset(, -1) = Target & " DEF"
  7.     End If
  8. End If
  9. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD