excel的vba操作我要把每个选中的单元格内容汇合在一起。看我的代码
答案:2 悬赏:80 手机版
解决时间 2021-03-21 04:56
- 提问者网友:不爱我么
- 2021-03-20 05:28
excel的vba操作我要把每个选中的单元格内容汇合在一起。看我的代码
最佳答案
- 五星知识达人网友:慢性怪人
- 2021-03-20 06:57
试下这个:
Public Sub sss()
Dim str As String, temp As String, CXrng As Range, XRrng As Range
Set CXrng = Selection
For Each XRrng In CXrng
str = str & XRrng.Value
XRrng.ClearContents
Next
CXrng(1) = str
End Sub
Public Sub sss()
Dim str As String, temp As String, CXrng As Range, XRrng As Range
Set CXrng = Selection
For Each XRrng In CXrng
str = str & XRrng.Value
XRrng.ClearContents
Next
CXrng(1) = str
End Sub
全部回答
- 1楼网友:有你哪都是故乡
- 2021-03-20 07:27
Sub t()
temp = ""
For Each c In Selection
temp = temp & c
Next
Selection.Item(1) = temp
End Sub
temp = ""
For Each c In Selection
temp = temp & c
Next
Selection.Item(1) = temp
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯