Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
RunCheck
End Sub
Private Sub RunCheck()
Dim i, j
For i = 1 To Sheet1.UsedRange.Rows.Count
For j = 1 To Sheet1.UsedRange.Columns.Count
Sheet1.Cells(i, j) = "'" + Sheet1.Cells(i, j).Text '在文本前面加上一个"'",将其变为字符串,如果想恢复原来的格式,把前面的"'"+几个字符删除,保存一下Excel就行了
Next
Next
End Sub
RunCheck
End Sub
Private Sub RunCheck()
Dim i, j
For i = 1 To Sheet1.UsedRange.Rows.Count
For j = 1 To Sheet1.UsedRange.Columns.Count
Sheet1.Cells(i, j) = "'" + Sheet1.Cells(i, j).Text '在文本前面加上一个"'",将其变为字符串,如果想恢复原来的格式,把前面的"'"+几个字符删除,保存一下Excel就行了
Next
Next
End Sub