如图片显示,一个单元格里面有多个单号,为了与其他表格对数方便,需要把用分隔号隔开的不同单号分成不同的行,一定要是行,不能是列,我要把所有单号发分成一个放到A列中。如果单单一个单元格的话,那我也可以用分列,然后复制→选择性粘贴的方法处理到,但是有没有一个公式可以全部处理好的,或者快捷的办法。因为分列然后选择性粘贴的话,每次只能处理一个单元格的数据,速度还是很慢。求高手指教
都不行啊,我这个只是举例,单号不止三位数的
æ¹æ³ä¸ï¼å æ å®ä½å¨1åï¼æalt+enterï¼ä¾æ¬¡ç±»æ¨ï¼æ¤æ³æ¯æ¢è¡ã
æ¹æ³äºï¼ä¹å¯ä»¥éä¸åå æ ¼åï¼æ ¼å¼ââåå æ ¼ï¼â对é½âé项æ å ï¼å³ä¾§ï¼æ¹åä¸ï¼éæ©ç«åæåçææ¬ï¼ç¡®å®ï¼
1.æ°æ®å¦ä¸å¾å 容ä¸æ ·ï¼é½å¨ä¸ä¸ªçµåè¡¨æ ¼å ã
2.é¦å å°ç¬¬ä¸ä¸ªçµåè¡¨æ ¼å大ï¼
3.éæ©æ°æ®ï¼ååã
4.å éä¸è¯¥åå æ ¼ï¼æ¯åå æ ¼å ¨è¢«éä¸ï¼å¦å¾ï¼
5.ç¹å»æ°æ®ä¸çååæé®ãå°±ä¼å¼¹åºä¸ä¸ªæ°çå¼¹æ¡ãå¦å¾;
6.å¨æ°å¼¹åºççªå£ä¸æ们éæ©âåºå®å®½åº¦ï¼ç¶åç¹å»ä¸ä¸æ¥ã
7.ä¹ååæ°å¼¹åºçå¼¹çªä¸æ们就å¯ä»¥è°æ´å®ä»¬çé´è·ï¼å°å®ä»¬çåååºæ¥ãç¶åç¹å»å®æã
8.å°±å®ç°äºä¸ä¸ªåå æ ¼éçå 容ä¹å¯ä»¥å¤å¶ç²è´´äºã
看了眼别人的公式,如果不是3位数就废了
我弄了一个公式挺麻烦的,不过可以保证不在乎你的数字到底是几位数,只要分隔符是逗号就好,一直可以
=MID(","&A$2&","&A$3&","&A$4&","&A$5&","&A$6&","&A$7&","&A$8&",",FIND("@",SUBSTITUTE(","&A$2&","&A$3&","&A$4&","&A$5&","&A$6&","&A$7&","&A$8&",",",","@",ROW()))+1,FIND("@",SUBSTITUTE(","&A$2&","&A$3&","&A$4&","&A$5&","&A$6&","&A$7&","&A$8&",",",","@",ROW()+1))-FIND("@",SUBSTITUTE(","&A$2&","&A$3&","&A$4&","&A$5&","&A$6&","&A$7&","&A$8&",",",","@",ROW()))-1)
上图看结果~:
我又做了个宏,可以适应更多的数据量,看上去也比公式更直观,易于修改
Sub aa()
Dim aaa(100) As String
ccc = "," '分割符号在这里修改
'连接所有字符
abc = Cells(2, 1).Value
For i = 3 To Range("a60000").End(xlUp).Row + 1
abc = abc & ccc & Cells(i, 1).Value
Next
b = 1
For m = 1 To Len(abc)
p = Mid(abc, m, 1)
If p <> ccc Then
aaa(b) = aaa(b) & p '分割字符
Else
Cells(b, 2).Value = aaa(b) '输出到单元格
b = b + 1
End If
Next
End Sub
不行,我这个只是举例,单号不止三位数的,有邮箱吗,发表格你看看
追答追问已经发过去了,求解答哈,谢了
追答已经给你发回
本回答被提问者和网友采纳