删除公式

​01 Sub 删除公式()

02 Dim Mywb As Workbook,Myws As Worksheet

03 Dim rng As Range,rngA As Range

04 For Each Mywb In Workbooks

05 With Mywb

06 For Each Myws In.Worksheets

07 On Error Resume Next

08 Set rngA=Myws.UsedRange.SpecialCells(xlCellTypeFormulas)

'获取公式单元格区域引用

09 For Each rng In rngA

10 rng.Value=rng.Value'将公式转换成数值

11 Next

12 Next

13 End With

14 Next

15 End Sub

(0)

相关推荐