您的位置:首页 > 其它

Excel 自动大写选择区域字符

2005-11-14 13:29 316 查看
Sub UpperSelection()

Dim i, j As Integer
Dim iAreaCnt As Integer, iLoop As Integer, iLoopSub1 As Integer, iLoopSub2 As Integer
iAreaCnt = Selection.Areas.Count '选择的区域的数目, 多数为1
For iLoop = 1 To iAreaCnt
i = Selection.Areas(iLoop).Columns.Count '区域内列数
j = Selection.Areas(iLoop).Rows.Count '区域内行数

For iLoopSub1 = 1 To i
For iLoopSub2 = 1 To j
Selection.Areas(iLoop).Cells(iLoopSub2, iLoopSub1) = _
UCase(Selection.Areas(iLoop).Cells(iLoopSub2, iLoopSub1)) '转为大写
Next
Next
Next
End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐