我遵循了一些数组教程,但是我在 VBA 中的代码对于我来说很难将其更改为我的基本知识的数组。
任何人都可以帮忙吗?
这是我的代码:
Sub InternExtern()
Dim source, addrescell, destination As Range
Dim Sourcevalue As String
For Each source In Range("E6", Range("E" & Rows.Count).End(xlUp))
If source.Value <> "" Then
For Each addrescell In Range("address_table_names").Rows
If addrescell.Cells(1).Value <> "" And InStr(source.Offset(0, 23).Value, "Extern") = 0 Then
SourceName = addrescell.Cells(1).Value
Sourcevalue = addrescell.Cells(1, 4).Value
If InStr(UCase(source), UCase(SourceName)) <> 0 Then
If InStr(Sourcevalue, "10.") <> 0 Or InStr(Sourcevalue, "192.168.") <> 0 Or IsInternal(addrescell.Offset(0, 3).Value) Then
source.Offset(0, 23) = "Intern"
Else: source.Offset(0, 23) = "Extern"
End If
End If
If InStr(source, "-ext-") <> 0 Or InStr(source, "any") <> 0 Or InStr(source, "-EXT-") <> 0 Then
source.Offset(0, 23) = "Extern"
End If
If InStr(source, "any") <> 0 And InStr(source.Offset(0, -1).Value, "FW-Peering") = 0 Then
source.Offset(0, 23) = "Intern"
End If
End If
Next addrescell
End If
Next source
我将列值添加到数组中的目标是让它更快。
提前致谢!