|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
RT,vba代码写入剪切板的内容 粘贴出来变成了2个框框,
代码如下:
Sub 计算()
Dim rag0 As Range, rag1 As Range, rag2 As Range
Dim X, Y, Z
Set rag0 = Intersect(Selection, ActiveSheet.UsedRange)
For Each rag1 In rag0
If WorksheetFunction.IsNumber(rag1.Value) = True Then
X = X & rag1.Address & "=" & rag1.Value & Chr(13)
Y = Y + Round(rag1.Value, 2)
Z = Z & rag1.Address & ","
End If
Next
Z = Left(Z, Len(Z) - 1)
UserForm1.TextBox1.Value = X
UserForm1.TextBox2.Value = Round(Y, 2)
UserForm1.TextBox3.Value = Z
Cells.Interior.ColorIndex = 0
Range(Z).Interior.Color = RGB(255, 255, 0)
'**********************************************************************************
Dim objData As New DataObject
objData.SetText Y
objData.PutInClipboard
End Sub
|
|