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

[µo°Ý] ¤lµ{§Ç°ÝÃD¡C

[µo°Ý] ¤lµ{§Ç°ÝÃD¡C

§Ú¦³¤@¬qVBA¦ý¬O§Ú«öALT+F11 §â¤U¦CVBAªº½s½X¥´¶i¥h«á,¤£¯à°õ¦æ,½Ð°Ý¬O¤£¬O¤í¤F¨ÇªF¦è,¦]¬°«ö¤F¤§«á¥X²{¤F¥L¥s§Ú¿é¤J ¥¨¶°¦WºÙ ¤~¯à°õ¦æ,ÁÂÁ ¥»¤H¬O·s¤â,¤@ª½¨Ï¥Îªº¬O sub () ¡C

Sub ModifyColumn(sColum As String, sKey As String)

Dim rngBase As Range

Dim iCount As Integer


iCount = 0

Set rngBase = ActiveSheet.Range(sColum & "1")

While Len(rngBase.Offset(iCount, 0).Value)

With rngBase.Offset(iCount, 0)

If InStr(.Value, sKey) Then

.Offset(0, -2).Value = .Value
.Delete shift:=xlShiftToLeft

End If

End With

iCount = iCount + 1

Wend

End Sub

¦^´_ 1# stephenlee

Sub ModifyColumn(sColum As String, sKey As String)
¬O»Ýµ¹°Ñ¼Æªºµ{§Ç½Ð¼g¤@µ{¦¡°õ¦æ¸Õ¸Õ¬Ý  '
  1. Sub Ex1()
  2.     ModifyColumn "a", "bc"
  3. End Sub
  4.    
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD