|
写了一个IP地址拆分的工具 现在卡住了,求解。
卡在了: For j = 0 To s_or_m - 1 这句
Sub 拆()
' 2024 02 04
RowCount = 2
For a = 1 To 900000
If Sheets("拆分表").Cells(a, 1) = "" Then
totalrow = a - 1
Exit For
End If
Next a
For i = 1 To totalrow
dhname = Sheets("拆分表").Cells(i, 1) '原IP
s_or_m = Sheets("拆分表").Cells(i, 6) ' IP地址个数
sip = Sheets("拆分表").Cells(i, 2) '斜线前的
mips = Sheets("拆分表").Cells(i, 3) '第三个.前的
miphead = Sheets("拆分表").Cells(i, 4) '从几开始写 最后一个点后面的数
If s_or_m = "" Then
Sheets("展开结果").Cells(RowCount, 2) = khname
Sheets("展开结果").Cells(RowCount, 1) = sip
Sheets("展开结果").Cells(RowCount, 3) = dhname
RowCount = RowCount + 1
Else
For j = 0 To s_or_m - 1
Sheets("展开结果").Cells(RowCount, 1) = mips & (miphead + j)
Sheets("展开结果").Cells(RowCount, 2) = dhname
RowCount = RowCount + 1
Next j
End If
Next i
End Sub
实现的效果样例在 展开结果的H和I列
|
|