Sub format_string()
Dim m As String
For i = 1 To 65535
If Cells(i, 11) <> "" Then
m = Cells(i, 11)
Cells(i, 11).Select
Selection.NumberFormatLocal = "@"
Cells(i, 11) = m
End If
If Cells(i, 12) <> "" Then
m = Cells(i, 12)
Cells(i, 12).Select
Selection.NumberFormatLocal = "@"
Cells(i, 12) = m
End If
If Cells(i, 14) <> "" Then
m = Cells(i, 14)
Cells(i, 14).Select
Selection.NumberFormatLocal = "@"
Cells(i, 14) = m
End If
If Cells(i, 15) <> "" Then
m = Cells(i, 15)
Cells(i, 15).Select
Selection.NumberFormatLocal = "@"
Cells(i, 15) = m
End If
Next
End Sub
本文提供了一个使用VBA宏脚本来批量调整Excel中特定单元格格式的方法,包括时间格式、货币格式和自定义格式等。通过筛选单元格条件并应用不同的格式,简化了格式调整过程,提高了工作效率。
618

被折叠的 条评论
为什么被折叠?



