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

½Ð°Ý²V¦X½s½X§ÚÀ³¸Ó«ç»ò°µ

¦^´_ 1# sheau-lan
«~¸¹¥u·|·s¼WÁÙ¬O·|¥h­×§ï¤§«eªº??
¨Ò¦p: ¦pªG­×§ï[A6]Àx¦s®æ¬°M4-xxx³W®æªº«~¸¹ , ¤U¤èªº¦s©ñ½s¸¹­n¥þ³¡§ó·s¶Ü??

¦pªG¤£¥ÎºÞ¡A¥i°Ñ¦Ò¤U­±¡F¦pªG­n¡A¤£¦p«Ø­Ó«ö¶s§ó·s¥þ³¡¦s©ñ½s¸¹¤ñ¸û¾A¥Î¡C
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     Dim ar, spec, prefix, count As Long
  3.     With Target
  4.         If .Row >= 3 And .Column = 1 Then
  5.             '¨ä¥¦Äæ³B²z²¤¹L, °²³]DÄæ¤w¨ú±o³W®æ
  6.             '.........
  7.             spec = Cells(.Row, "D").Value
  8.             prefix = Split(spec, "-")(0)
  9.             ar = Range(Cells(1, "H"), Cells(.Row - 1, "H"))
  10.             For Each x In ar
  11.                 If prefix = Split(x, "-")(0) Then
  12.                     count = count + 1
  13.                 End If
  14.             Next
  15.             Application.EnableEvents = False
  16.             Cells(.Row, "H").Value = prefix & "-" & Replace(Cells(1, count / 4 + 1).Address(False, False), "1", "")
  17.             Application.EnableEvents = True
  18.         End If
  19.     End With
  20. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : µoµÊ®ð¬Oµu¼ÈªºµoºÆ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD