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

[µo°Ý] Â^¨ú·Q­nªº¤å¦r¤º®evba

[µo°Ý] Â^¨ú·Q­nªº¤å¦r¤º®evba

¥­®ÉÂ^¨ú·Q­nªº¤å¦r¤º®e¦h¼Æ¥Îexcel ¤½¦¡,¦pªG¥Îvba«ç»òªí¹F??
±ø¥ó§R°£¦rªº³Ì«á4­Ó¦r"-abcd"

Â^¨ú·Q­nªº¤å¦r¤º®e.png (318.78 KB)

Â^¨ú·Q­nªº¤å¦r¤º®e.png

¦^´_ 1# john2006168
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim AR(), Rng As Range, i As Integer
  4.     Set Rng = Range("A2", Range("A2").End(xlDown))
  5.     AR = Rng.Value
  6.     For i = 1 To UBound(AR)
  7.         If InStrRev(UCase(AR(i, 1)), "-ABCD") > 0 Then AR(i, 1) = Mid(AR(i, 1), 1, InStrRev(UCase(AR(i, 1)), "-ABCD") - 1)
  8.     Next
  9.     Rng.Offset(, 1) = AR
  10. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE
ÁÂÁÂ,¦¨¥\.

TOP

{=LEFT(A2,MAX((MID(A2,ROW($1:$99),1)="-")*ROW($1:$99))-1)
google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

©T©w§R³Ì«á¢³¦r
=LEFT(A2,LEN(A2)-4)
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

§R°£³Ì«á "-" ¥H«á¸ê®Æ
=LEFT(A2,LOOKUP(1,0/(MID(A2,ROW($1:$99),1)="-"),ROW($1:$99)-1))
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

        ÀR«ä¦Û¦b : ­n¤ñ½Ö§ó¨ü½Ö¡D¤£­n¤ñ½Ö§ó©È½Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD