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

[µo°Ý] ¼Æ²Õ¬A¸¹¤ºªº¼Æ¦r ¤À§é

  1. Sub zz()
  2. Dim s$
  3. s = "2301(1,3,5-7,9-0)"
  4. With CreateObject("vbscript.regexp")
  5.     .Pattern = "\d+"
  6.     .Global = True
  7.     k = Split(s, "(")
  8.     If .test(k(1)) Then
  9.         Set t = .Execute(k(1))
  10.         For Each x In t
  11.             Debug.Print k(0) & x
  12.         Next
  13.     End If
  14. End With
  15. End Sub
½Æ»s¥N½X

TOP

9-0 ???
¦³¨S¦³9-2¤§Ãþªº,
Á|ªº¨Ò¤l¥u¦³¤@­Ó, µ{¦¡¼g¤F¤]¬O¥Õ¼g,
¤W¶Ç¸û§¹¾ãªº¼Æ¾Ú§a!!!

TOP

google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-10-4 01:07 ½s¿è

¦^´_ 2# n7822123


§ó¥¿! §Ñ°O¥[«e­±ªº¼Æ¦r¤F
  1. Sub TEST()
  2. Ar = Split(Replace([A1], "-", ","), ",")
  3. A0 = Left(Ar(0), InStr(Ar(0), "(") - 1)
  4. Ar(0) = Right(Ar(0), Len(Ar(0)) - InStr(Ar(0), "("))
  5. An = UBound(Ar)
  6. Ar(An) = Left(Ar(An), Len(Ar(An)) - 1)
  7. For i = 0 To An
  8.   Ar(i) = A0 & Ar(i)
  9. Next i
  10. [B1].Resize(An + 1) = Application.Transpose(Ar)
  11. End Sub
½Æ»s¥N½X
BBB.rar (10.53 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-10-4 00:53 ½s¿è

¦^´_ 1# adrian_9832

­n¥Î¤@¨Ç¸Ñ¦r¦êªº§Þ¥©
VBA¦p¤U¡A§âA1¸ÑªR«á©ñ¨ìBÄæ
¤½¦¡§ä§O¤HÀ°¦£§a.......§Ú¤u§@ªí¨ç¼Æ·|ªº¤£¦h
¥uª¾¹Dinstr ¥i¥H¥Î find ¨ú¥N
¦ý¬Osplit ¤£ª¾¹D¤u§@ªí¨ç¼Æ¦³¨S¦³Ãþ¦üªº
  1. Sub TEST()
  2. Ar = Split(Replace([A1], "-", ","), ",")
  3. Ar(0) = Right(Ar(0), Len(Ar(0)) - InStr(Ar(0), "("))
  4. An = UBound(Ar)
  5. Ar(An) = Left(Ar(An), Len(Ar(An)) - 1)
  6. [B1].Resize(An + 1) = Application.Transpose(Ar)
  7. End Sub
½Æ»s¥N½X
AAA.rar (10.16 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ­ì½Ì§O¤H´N¬Oµ½«Ý¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD