0
点赞
收藏
分享

微信扫一扫

excel导入数据库 excel导入datatable 时间变数字 字符文本格式化 VBA 指定到列

Sub format_string()
Dim m As StringFor 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

NextEnd Sub

举报

相关推荐

0 条评论