Excle VBA 四舍五入粘贴
2010-07-15 22:36:22| 分类:
Excel自动化
| 标签:
|举报
|字号大中小 订阅
Sub test()
Dim MyData As DataObject, MyStr As String 'DataObject对象需要Form对象
Set MyData = New DataObject
If Application.CutCopyMode = 0 Then
MsgBox "空"
Else
MyData.GetFromClipboard
MyStr = MyData.GetText
MsgBox MyStr
If IsNumeric(MyStr) Then ‘判断是否是数值
ActiveCell = WorksheetFunction.Round(MyStr, 2)
Else
ActiveCell = MyStr
End If
End If
End Sub
评论这张
转发至微博
转发至微博
评论