Sub AddVersionZero()
'关闭屏幕更新,提升运行速度
Application.ScreenUpdating = False
'声明变量
Dim lastRow As Long
Dim i As Long
Dim originalName As String
Dim newName As String
'获取A列最后一行有数据的行号
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
'遍历数据行(从第2行开始,第1行是表头)
For i = 2 To lastRow
'获取原文件名
originalName = Cells(i, "A").Value
'判断单元格是否为空
If originalName "" Then
'核心逻辑:第14位后插入0
newName = Left(originalName, 14) & "0" & Mid(originalName, 15)
'===== 两种模式二选一,注释掉不需要的即可 =====
'模式1:安全模式 → 写入B列,不改动原数据(推荐)
Cells(i, "B").Value = newName
'模式2:直接修改模式 → 替换A列原数据
'Cells(i, "A").Value = newName
'=============================================
End If
Next i
'恢复屏幕更新
Application.S
...查看全文