小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋

反选EXCEL数据区域已选定的单元格

Sub 反选()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim raddress As String, taddress As String
raddress = Selection.Address
taddress = ActiveSheet.UsedRange.Address
With Sheets.Add
.Range(taddress) = 0
.Range(raddress) = "=0"
raddress = .Range(taddress).SpecialCells(xlCellTypeConstants, 1).Address
.Delete
End With
ActiveSheet.Range(raddress).Select
Application.ScreenUpdating = True
End Sub

 

posted on 2007-09-23 13:57  王峰炬  阅读(294)  评论(0编辑  收藏  举报

导航