- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2017-7-29 09:58 ½s¿è
¦^´_ 1# v03586
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim E As Range, sp As Variant, i As Integer, Msg As Boolean, St As String
- St = ",AAP,PPA,QQP,POO," '¥½½X³W«h
- With Range("h2").CurrentRegion
- 'Range.CurrentRegion ÄÝ©Ê ¶Ç¦^ Range ª«¥ó¡A¸Óª«¥ó¥Nªí¥Ø«eªº°Ï°ì¡C¥Ø«e°Ï°ì¬O«ü¥H¥ô·NªÅ¥Õ¦C¤ÎªÅ¥ÕÄ檺²Õ¦X¬°Ãä¬Éªº½d³ò¡C°ßŪªº¡C
- For Each E In .Cells
- sp = Split(E.Value, "-")
- 'Split ¨ç¼Æ ¶Ç¦^¤@Ó³¯¦C¯Á¤Þ±q¹s¶}©lªº¤@ºû°}¦C , ¥¦¥]§t«ü©w¼Æ¥Øªº¤l¦r¦ê
- Msg = InStr(St, "," & UCase(UBound(sp)) & ",")
- For i = 0 To UBound(sp) - IIf(Msg, 2, 1)
- E = Replace(E, sp(i) & "-", "")
- 'Replace ¨ç¼Æ ¶Ç¦^¤@Ó¦r¦ê , ¸Ó¦r¦ê¤¤«ü©wªº¤l¦r¦ê¤w³Q¨ú¥N¦¨¥t¤@¤l¦r¦ê, ¨Ã¥B¨ú¥Nµo¥Íªº¦¸¼Æ¤]¬O«ü©wªº
- Next
- Next
- .BorderAround LineStyle:=xlContinuous, Weight:=xlMedium, ColorIndex:=xlAutomatic
- For Each E In .Cells
-
- With E.Borders(9) 'xlInsideVertical
- .LineStyle = xlContinuous
- .ColorIndex = xlAutomatic
- .TintAndShade = 0
- .Weight = IIf(E.Offset(1) <> E, xlThick, xlMedium)
- End With
- Next
- End With
- End Sub
½Æ»s¥N½X |
|