利用vb将excel数据转换成word

excelword

1个回答

写回答

838728096@qq.com

2025-10-28 07:20

+ 关注

excel
excel

excel按学校排序 我给你写个VBA代码吧,直接在excel里运行宏就行啦 如果你的数据在sheet1,就把代码贴到sheet1里 代码如下:sub x() dim r as integer ,c as integer dim s as string,sn as string ,sx as string r=2 c=1 sn = sx = do sx=cells(r,c) if sx= then exit do if not sn = sx then s = s & vbcrlf & sx & vbcrlf sn=sx endif s= s & & cells(r,c+1) r=r+1 loop cells(r+1,c) =s '后面的复制操作我一时想不起来,你可以把结果复制到word里处理下,很简单,我先下了,改天补上 这代码挺简单的,你试试看行不行,有问题再问我

举报有用(0分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号