运行该Sub,所有单元格的字母都会变成大写的
Sub
cap()
Dim
cell
As
Range
For
Each
cell In UsedRange
cell.Value
=
UCase
$(cell.Value)
Next
End Sub
给定一段时间,计算出什么时候到期
Sub
deadline()
Dim
deadtime
As
Date
deadtime
=
DateAdd
(
"
d
"
, Cells(
2
,
2
),
Now
)
'
day
deadtime
=
DateAdd
(
"
h
"
, Cells(
2
,
3
), deadtime)
'
hour
deadtime
=
DateAdd
(
"
n
"
, Cells(
2
,
4
), deadtime)
'
minute
ActiveCell.Value
=
deadtime
End Sub
'
选中右移
ActiveCell.Value
=
123
Cells(ActiveCell.Row, ActiveCell.Column
+
1
).Select
ActiveCell.Value
=
456
posted on 2009-05-20 20:20
Jcat 阅读(189)
评论(0) 编辑 收藏 所属分类:
VBA