- ©«¤l
- 396
- ¥DÃD
- 12
- ºëµØ
- 0
- ¿n¤À
- 425
- ÂI¦W
- 1
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2013-7-2
- ³Ì«áµn¿ý
- 2024-8-23
|
¥»©«³Ì«á¥Ñ owen06 ©ó 2014-12-23 11:20 ½s¿è
¦^´_ 7# sheau-lan
¸É¥R¤@¤U¡A§A¥ÎLEFT¡BMID¡BRIGHT¥h§ì¥X¯S©w¦r¦ê«á¡AÁöµM§A¬Ý¨ìªº¼Ë»ª¬O¼Æ¦r¡A¦ý¥Lªº¥»½è¨ä¹ê¬O¤å¦r¡A³o¼Ë§Avlookup¬O¤ñ¤£¥X¨Óªº¡A©Ò¥H§AÁÙn¦A§â¥L*1¡A¥Lªº ¥»½è¤~·|§ïÅܬ°¼ÆÈ¡A¦Ó§AªºÀɮ׫e±¦³ÓF¡A¥L´N¬O¤å¦r®æ¦¡¡A¦]¦¹¤£»Ýn¦A¥Î*1¡C
§ï³o¼Ë§A¸Õ¬Ý¬Ý- Private Sub Worksheet_Change(ByVal Target As Range)
- On Error GoTo 99
- With Target
- code = Left(.Value, 6)
- num = .Offset(-1, -1)
- If .Row >= 3 And .Column = 2 And .Offset(-1, 0) <> "" Then
- If .Value = "" Then
- .Offset(0, -1) = ""
- .Offset(0, 5) = ""
- ElseIf .Address = [b3].Address Then
- .Offset(0, -1) = "0001"
- .Offset(0, 5) = Application.VLookup(code, Sheet2.[a1:b65536], 2, False)
- Else:
- .Offset(0, -1) = Application.Text(num + 1, "0000")
- .Offset(0, 5) = Application.VLookup(code, Sheet2.[a1:b65536], 2, False)
- End If
- End If
- End With
- 99
- End Sub
½Æ»s¥N½X |
|