/分流标识文件 / -----------------------
/主分流 / ------------
S101 S103 S105 S106 S107
S108 S112 S113 S115 S116
S117 S118 S119 S120 S122
S123 S505 S507 S509 S510
S511 S512
/ ---------------------------------------------- ---------------------------------
您好我想在VBA中对上述内容进行编码,以便只有" S ###"正在excel列中读取和复制。所以我设法在下面编写代码,然后处理以S开头的任何内容。
感谢您的帮助
Open selectedPaths(I) For Input As #1
Close #1
x = 4
Do While Not EOF(1)
Line Input #1, txt
Lines = Split(txt, " ")
For Each Line In Lines
If Line Like "S*" Then
If x Mod 30 = 0 Then
x = x + 4
End If
Cells(x, 1) = Line
x = x + 1
Cells(x, 1) = Line
If x Mod 30 <> 0 Then
x = x + 1
End If
End If
Next
Loop
Close #1
Next I
End If
答案 0 :(得分:0)
替换
If Line Like "S*" Then
带
If Line Like "S????" Then