Sub setText(sh As Worksheet)
Dim cell As Range '声明单元格对象变量
Dim 计算状态 As Long
计算状态 = Application.Calculation
If 计算状态 = xlAutomatic Then Application.Calculation = xlManual '如当前是自动改为手动计算,不然如有随机函数会在转化过程中数值变化
For Each cell In ActiveSheet.UsedRange
If Len(cell) > 14 Then
cell.NumberFormat = "@"
cell.Value = cell.Value
ElseIf cell.HasFormula Then
cell.NumberFormat = "@"
cell.Value = cell.Value
End If
Next cell
Application.Calculation = 计算状态 '恢复之前计算状态
End Sub