VBA,设置单元格格式为文本:
Public Sub demo()
irow = ActiveSheet.UsedRange.Rows.Count
For i = 2 To irow
If Len(Range("E" & i).Value) = 4 And CStr(Range("E" & i).Value) <> "0000" Then
Range("F" & i).NumberFormatLocal = "@"
Range("F" & i).Value = CStr(Range("A" & i).Text) + "30506" + CStr(Range("E" & i).Text)
End If
Next i
End Sub
Range("A1").NumberFormatLocal = "@"