EXCEL中VBA编程问题

2024-12-13 17:48:01
推荐回答(2个)
回答1:

hello!

改:Range("c1") = Mid(j, i + 2, (k - i - 2))
第二句没理解是什么意思。
____________________________________________________________________
Sub jq()

Dim i, j, k, m, n, ra

ra = [a65536].End(3).Row

For m = 1 To ra

j = Cells(m, 1).Value

i = InStr(j, "DN")

k = InStr(i, j, "-")

Cells(m, 2).Value = Mid(j, i + 2, (k - i - 2))

Next m

End Sub

回答2:

sub zjh()
dim i%, mStr$
for i=1 to [b1].end(4).row
mstr=cstr(cells(i,2).value)
cells(i,3).value=MID(mstr,FIND("DN",mstr),FIND("-",mstr)-FIND("DN",mstr))
next i
end sub