I followed some array tutorials, but my code in VBA is too difficult for me to change it into arrays for my basic knowledge.
Can anyone help?
This is my code:
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
My goal of adding the column values into arrays is to make it faster.
Thanks in advance!