Function ExtractNumbers(CellVal As String, lenCell As Integer) As Integer
Dim Rnj As Range, cellLngth As Integer, numPosition As Integer, strTarget As String
strTarget = ""
For numPosition = 1 To lenCell
If IsNumeric(Mid(CellVal, numPosition, 1)) Then
strTarget = strTarget & Mid(CellVal, numPosition, 1)
End If
Next numPosition
ExtractNumbers = Len(strTarget) + 11
End Function
Function GetFolder() As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = Application.DefaultFilePath
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
End Function
Function StripChar(Txt As String) As Variant
With CreateObject("VBScript.RegExp")
.Global = True
.Pattern = "\D"
StripChar = Val(.Replace(Txt, " "))
End With
End Function
Public Function IsInArray(stringToBeFound As String, arr As Variant) As Boolean
Dim i
For i = LBound(arr) To UBound(arr)
If arr(i) = stringToBeFound Then
IsInArray = True
Exit Function
Else
IsInArray = False
End If
Next i
End Function
Function CheckIfSheetExists(SheetName As String) As Boolean
Dim WS As Worksheet
CheckIfSheetExists = False
For Each WS In Worksheets
If SheetName = WS.Name Then
CheckIfSheetExists = True
Exit Function
End If
Next WS
End Function
Function CountFiles(Path As String)
Dim FullPath As String
Dim FileName As String
FileName = Dir(Path & "*.txt")
Dim xCount As Integer
xCount = 0
Do While FileName <> ""
xCount = xCount + 1
FileName = Dir()
Loop
FileName = Dir(Path & "*.log")
Do While FileName <> ""
xCount = xCount + 1
FileName = Dir()
Loop
CountFiles = xCount
End Function
Public Function RegExx(cell As String) As Boolean
Dim regexObject As RegExp
Set regexObject = CreateObject("VBScript.RegExp")
Dim str As String
regexObject.Pattern = "\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\."
If regexObject.Test(cell) = True Then RegExx = True
End Function
Public Sub Analysis()
'Hostname Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="hostname")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(2, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), 9, 50))
End If
y = 0
'Username Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="username")
i = 0
If Not rng Is Nothing Then
y = rng.row
strUser = Mid(Sheets(FileName).Cells(y, 1), 10, 50)
If InStr(1, strUser, " ") > 0 Then
strUser = Left(strUser, InStr(1, strUser, " ") - 1)
End If
Sheets(FileName & " Analysis").Cells(3, 2) = strUser
Do Until rng Is Nothing Or i = 51
Set rng = Sheets(FileName).Range("A" & y + 1 & ":A" & Sheets(FileName).UsedRange.Rows.Count).find(What:="username")
If Not rng Is Nothing Then
y = rng.row
strUser = strUser & Mid(Sheets(FileName).Cells(y, 1), 10, 50)
' strUser = Left(strUser, InStr(1, strUser, " ") - 1)
If InStr(1, strUser, " ") > 0 Then
strUser = Left(strUser, InStr(1, strUser, " ") - 1)
End If
If strUser <> strOrigUser Then Sheets(FileName & " Analysis").Cells(3, 2) = Sheets(FileName & " Analysis").Cells(3, 2) & Chr(10) & strUser
strOrigUser = strUser
End If
strUser = ""
i = i + 1
Loop
If strUser <> "" Then
Sheets(FileName & " Analysis").Cells(3, 2) = Sheets(FileName & " Analysis").Cells(3, 2) & Chr(10) & strUser
Else
Sheets(FileName & " Analysis").Cells(3, 2) = "There are no users in the config file – see login interfaces below"
End If
End If
'PWD Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="PWD")
If Not rng Is Nothing Then
y = rng.row
If Sheets(FileName).Cells(y, 1) = "PWD" Then Sheets(FileName & " Analysis").Cells(4, 2) = Sheets(FileName).Cells(y, 3)
Set rng = Nothing
Else
Set rng = Sheets(FileName).Range("A:A").find(What:="password")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(4, 2) = Sheets(FileName).Cells(y, 3)
End If
End If
y = 0
'Software Version Initial
Dim strComma As String
Set rng = Sheets(FileName).Range("A:A").find(What:="SW:")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(5, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "SW:") + 4, 50))
End If
If rng Is Nothing Then
Set rng = Sheets(FileName).Range("A:A").find(What:=", Version")
If Not rng Is Nothing Then
y = rng.row
' If InStr(1, Sheets(FileName).Cells(y, 1), "show version") = 0 Then
' yOrig = y
' Sheets(FileName & " Analysis").Cells(5, 2) = Sheets(FileName).Cells(y, 1)
' End If
strComma = Trim(Mid(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "Version") + 8, 10))
If InStr(1, strComma, ",") > 0 Then
strComma = Left(strComma, InStr(1, strComma, ",") - 1)
ElseIf InStr(1, strComma, "[") > 0 Then
strComma = Left(strComma, InStr(1, strComma, "[") - 1)
End If
Sheets(FileName & " Analysis").Cells(5, 2) = strComma
End If
End If
If rng Is Nothing Then
Set rng = Sheets(FileName).Range("A:A").find(What:="Software")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(5, 2) = Trim(Sheets(FileName).Cells(y, 1))
End If
End If
If rng Is Nothing Then
Set rng = Sheets(FileName).Range("A:A").find(What:="SW version")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(5, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), 12, 50))
End If
End If
If rng Is Nothing Then
Set rng = Sheets(FileName).Range("A:A").find(What:="IOS")
If Not rng Is Nothing Then
y = rng.row
If y < yOrig Then
Sheets(FileName & " Analysis").Cells(5, 2) = Trim(Sheets(FileName).Cells(y, 1))
End If
End If
End If
If rng Is Nothing Then
x = 5
Do Until x = 30
If InStr(1, LCase(Sheets(FileName).Cells(x, 1)), "version") > 0 Or InStr(1, LCase(Sheets(FileName).Cells(x, 1)), "ios") > 0 Or InStr(1, LCase(Sheets(FileName).Cells(x, 1)), "software") > 0 Then
y = x
Sheets(FileName & " Analysis").Cells(5, 2) = Sheets(FileName).Cells(y, 1)
Exit Do
End If
x = x + 1
Loop
End If
y = 0
'Hardware Initial (Model)
Set rng = Nothing
Set rng = Sheets(FileName).Range("A:A").find(What:="HW:")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(6, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "HW:") + 4, 50))
Set rng = Nothing
End If
If rng Is Nothing Then
Set rng = Sheets(FileName).Range("A:A").find(What:="System Type:")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(6, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "Software Version:") + 13, 50))
Set rng = Nothing
End If
End If
If rng Is Nothing Then
Dim intColon As Integer
Set rng = Sheets(FileName).Range("A:A").find(What:="Model Number")
If Not rng Is Nothing Then
y = rng.row
intColon = InStr(1, Sheets(FileName).Cells(y, 1), ":")
Sheets(FileName & " Analysis").Cells(6, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), intColon + 1, 50))
Else
Sheets(FileName & " Analysis").Cells(6, 2) = "Not found"
End If
End If
If rng Is Nothing Then
Set rng = Sheets(FileName).Range("A:A").find(What:="System Type:")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(6, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), 13, 50))
Set rng = Nothing
Else
Sheets(FileName & " Analysis").Cells(6, 2) = "Not found"
End If
End If
If rng Is Nothing Then
Set rng = Sheets(FileName).Range("A:A").find(What:="HW version")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(6, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), 12, 50))
End If
End If
y = 0
'Uptime Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="uptime is")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(7, 2) = Mid(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "uptime is") + 10, 100)
Set rng = Nothing
End If
y = 0
'Arp/Exec Timeout Initial
'NTP Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="ntp server")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(9, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), 11, 50))
If Left(Sheets(FileName).Cells(y + 1, 1), 6) = Left(Sheets(FileName).Cells(y, 1), 6) Then
Sheets(FileName & " Analysis").Cells(9, 2) = Sheets(FileName & " Analysis").Cells(9, 2) & " "
Sheets(FileName & " Analysis").Cells(9, 2) = Sheets(FileName & " Analysis").Cells(9, 2) & Sheets(FileName).Cells(y + 1, 1)
End If
Set rng = Nothing
End If
If Sheets(FileName & " Analysis").Cells(9, 2) = "" Then
If InStr(1, Sheets(FileName).Cells(y + 1, 1), "server") > 0 Then
y = y + 1
Do Until InStr(1, Sheets(FileName).Cells(y, 1), "server") = 0
Sheets(FileName & " Analysis").Cells(9, 2) = Sheets(FileName).Cells(y, 1)
y = y + 1
Loop
End If
End If
If Sheets(FileName & " Analysis").Cells(9, 2) = "" Then
Sheets(FileName & " Analysis").Cells(9, 2) = "There are no NTP Servers specified for this device."
End If
y = 0
'Users -Groups: Initial
On Error Resume Next
Set rng = Sheets(FileName).Range("A:A").find(What:="password 5")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "password 5") + 10)
Sheets(FileName & " Analysis").Cells(10, 2).Font.Color = 255
End If
Set rng = Sheets(FileName).Range("A:A").find(What:="password 7")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "password 7") + 10)
Sheets(FileName & " Analysis").Cells(10, 2).Font.Color = 255
End If
Set rng = Sheets(FileName).Range("A:A").find(What:="password 0")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "password 0") + 10)
Sheets(FileName & " Analysis").Cells(10, 2).Font.Color = 255
End If
Set rng = Sheets(FileName).Range("A:A").find(What:="secret 5")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "secret 5") + 8)
End If
Set rng = Sheets(FileName).Range("A:A").find(What:="secret 7")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "secret 7") + 8)
End If
Set rng = Sheets(FileName).Range("A:A").find(What:="secret 9")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "secret 9") + 8)
End If
y = 0
i = 0
Set rng = Sheets(FileName).Range("A:A").find(What:="username")
If Not rng Is Nothing Then
y = rng.row
strOrigUser = Sheets(FileName).Cells(y, 1)
If Sheets(FileName & " Analysis").Cells(10, 2) <> "" Then
If InStr(1, Sheets(FileName).Cells(y + 1, 1), "password") = 0 Then
Sheets(FileName & " Analysis").Cells(10, 2) = Sheets(FileName & " Analysis").Cells(10, 2) & Chr(10) & Sheets(FileName).Cells(y, 1)
ElseIf InStr(1, Sheets(FileName).Cells(y + 1, 1), "password") <> 0 And InStr(1, Sheets(FileName).Cells(y, 1), "password") = 0 Then
Sheets(FileName & " Analysis").Cells(10, 2) = Sheets(FileName & " Analysis").Cells(10, 2) & Chr(10) & Sheets(FileName).Cells(y, 1) & " " & Mid(Sheets(FileName).Cells(y + 1, 1), 2, 11)
Else
Sheets(FileName & " Analysis").Cells(10, 2) = Sheets(FileName & " Analysis").Cells(10, 2) & Chr(10) & Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "password") + 10)
End If
Else
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "password") - 1)
End If
' i = 0
' y = y + 1
Do Until rng Is Nothing Or i = 51
Set rng = Sheets(FileName).Range("A" & y & ":A" & Sheets(FileName).UsedRange.Rows.Count).find(What:="username")
If Not rng Is Nothing Then
y = rng.row
If strOrigUser <> Sheets(FileName).Cells(y, 1) Then
strOrigUser = Sheets(FileName).Cells(y, 1)
If Sheets(FileName & " Analysis").Cells(10, 2) <> "" Then
If InStr(1, Sheets(FileName).Cells(y, 1), "privilege") > 0 Then
Sheets(FileName & " Analysis").Cells(10, 2) = Sheets(FileName & " Analysis").Cells(10, 2) & Chr(10) & Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "password") + 10)
Else
Sheets(FileName & " Analysis").Cells(10, 2) = Sheets(FileName & " Analysis").Cells(10, 2) & Chr(10) & Sheets(FileName).Cells(y, 1) & " " & Trim(Mid(Sheets(FileName).Cells(y + 1, 1), 2, 10))
End If
Else
Sheets(FileName & " Analysis").Cells(10, 2) = Left(Sheets(FileName).Cells(y, 1), InStr(1, Sheets(FileName).Cells(y, 1), "password") + 9)
End If
End If
i = i + 1
End If
Loop
End If
Clock:
On Error GoTo 0
'Clock Timezone Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="Clock Timezone")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(11, 2) = Trim(Mid(Sheets(FileName).Cells(y, 1), 16, 25))
Else
Sheets(FileName & " Analysis").Cells(11, 2) = "A timezone is not set on this device."
Sheets(FileName & " Analysis").Cells(11, 2).Font.Color = 255
End If
y = 0
'Banner Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="banner")
If Not rng Is Nothing Then
y = rng.row
i = 1
Do Until InStr(1, Sheets(FileName).Cells(y + i, 1), "*") = 0
strBanner = strBanner + Sheets(FileName).Cells(y + i, 1) & Chr(10)
If InStr(1, strBanner, "banner motd ") > 0 Then strBanner = Replace(strBanner, "banner motd ", "")
i = i + 1
Loop
Sheets(FileName & " Analysis").Cells(12, 2) = strBanner
Else
Set rng = Sheets(FileName).Range("A:A").find(What:="banner")
If Not rng Is Nothing Then
y = rng.row
i = 1
Do Until InStr(1, Sheets(FileName).Cells(y + i, 1), "*") = 0
strBanner = strBanner + Sheets(FileName).Cells(y + i, 1) & Chr(10)
If InStr(1, strBanner, "banner motd ") > 0 Then strBanner = Replace(strBanner, "banner motd ", "")
i = i + 1
Loop
Sheets(FileName & " Analysis").Cells(12, 2) = strBanner
End If
End If
If Sheets(FileName & " Analysis").Cells(12, 2) = "" Then
Sheets(FileName & " Analysis").Cells(12, 2) = "There is no banner set on this device."
Sheets(FileName & " Analysis").Cells(12, 2).Font.Color = 255
End If
y = 0
strBanner = ""
'Radius AAA Server and Tacacs Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="AAA Server")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(13, 2) = "AAA Server"
Else
Set rng = Sheets(FileName).Range("A:A").find(What:="Tacacs")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(13, 2) = "Tacacs Server"
Else
Sheets(FileName & " Analysis").Cells(13, 2) = "There is no AAA server or Tacacs set on this device."
End If
End If
y = 0
'Control Plane Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="control-plane")
If Not rng Is Nothing Then
y = rng.row
blCP = True
Sheets(FileName & " Analysis").Cells(14, 2) = "See Appendix A"
Sheets.Add Sheets(FileName & strWS)
ActiveSheet.Name = FileName & strCP
ActiveSheet.Tab.Color = tabCol
With ActiveSheet.Cells(1, 1)
.Value = "Control Planes"
.Font.Bold = True
End With
a = y
Do Until aBool = True Or InStr(1, Sheets(FileName).Cells(a + ai, 1), "end") > 0
If InStr(1, Sheets(FileName).Cells(a + ai, 1), "!") > 0 Then
aCnt = aCnt + 1
GoTo NextTry
Else
Sheets(FileName & strCP).Cells(CPR, 1) = Sheets(FileName).Cells(a + ai, 1)
aCnt = 0
CPR = CPR + 1
End If
NextTry:
ai = ai + 1
If aCnt = 4 Then Exit Do
Loop
Else
Sheets(FileName & " Analysis").Cells(14, 2) = "See Appendix A"
If Len(FileName & strCP) > 30 Then strCP = "CP"
Sheets.Add Sheets(FileName & strWS)
ActiveSheet.Name = FileName & strCP
With ActiveSheet.Cells(1, 1)
.Font.Bold = True
.Value = "Control Planes"
End With
ActiveSheet.Tab.Color = tabCol
ActiveSheet.Cells(2, 1) = "There were no Control Planes listed with this host."
End If
y = 0
CPR = 2
aCnt = 0
ai = 1
ActiveSheet.Range("A:A").Columns.AutoFit
Sheets(FileName & " Analysis").Activate
Do Until x > Sheets(FileName & strCP).UsedRange.Rows.Count
Application.DisplayAlerts = False
With Sheets(FileName & strCP).Range("A" & x & ":H" & x)
.MergeCells = True
.WrapText = True
End With
x = x + 1
Loop
'Routing Protocols Initial
If Len(FileName & " Routing Protocols") <= 30 Then
strRP = " Routing Protocols"
ElseIf Len(FileName & " Routing Prot") <= 30 Then
strRP = " Routing Prot"
Else
strRP = " RP"
End If
If WorksheetExists(FileName & strRP) = False Then
Sheets.Add , ActiveSheet
ActiveSheet.Name = FileName & strRP
ActiveSheet.Tab.Color = tabCol
With ActiveSheet.Cells(1, 1)
.Font.Bold = True
.Value = "Routing Protocols"
End With
End If
Set rng = Sheets(FileName).Range("A:A").find(What:="router ospf 1")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & strRP).Cells(2, 1) = rng.Value
y = y + 1
Do Until InStr(1, Sheets(FileName).Cells(y, 1), "!") > 0
Sheets(FileName & strRP).Cells(Sheets(FileName & strRP).UsedRange.Rows.Count + 1, 1) = Sheets(FileName).Cells(y, 1)
y = y + 1
Loop
Else
Sheets(FileName & strRP).Cells(2, 1) = "There are no routing protocols associated with this device."
End If
'SSH Server Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="SSH Server")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(15, 2) = True
Else
Sheets(FileName & " Analysis").Cells(15, 2) = "N/A"
End If
y = 0
'SSH Timeout Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="ssh timeout")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(16, 2) = Trim(Sheets(FileName).Cells(y, 1))
Else
Set rng = Sheets(FileName).Range("A:A").find(What:="ssh timeout")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(16, 2) = Trim(Sheets(FileName).Cells(y, 1))
End If
End If
y = 0
'Logging Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="logging")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(17, 2) = Sheets(FileName).Cells(y, 1)
strLog = Sheets(FileName).Cells(y, 1)
y = y + 1
Do Until rng Is Nothing
Set rng = Sheets(FileName).Range("A" & y & ":A" & Sheets(FileName).UsedRange.Rows.Count).find(What:="logging")
If Not rng Is Nothing Then
y = rng.row
If strLog <> Sheets(FileName).Cells(y, 1) Then
Sheets(FileName & " Analysis").Cells(17, 2) = Sheets(FileName & " Analysis").Cells(17, 2) & Chr(10) & Sheets(FileName).Cells(y, 1)
strLog = Sheets(FileName).Cells(y, 1)
Else
y = y + 1
End If
'y = y + 1
End If
Loop
Else
Sheets(FileName & " Analysis").Cells(17, 2) = "There are no logging servers set on this device."
Sheets(FileName & " Analysis").Cells(17, 2).Font.Color = 255
End If
y = 0
'SNMP Server Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="snmp-server")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(18, 2) = Sheets(FileName).Cells(y, 1)
y = y + 1
Do Until InStr(1, Sheets(FileName).Cells(y, 1), "snmp-server") = 0
Sheets(FileName & " Analysis").Cells(18, 2) = Sheets(FileName & " Analysis").Cells(18, 2) & Chr(10) & Sheets(FileName).Cells(y, 1)
y = y + 1
Loop
Else
Sheets(FileName & " Analysis").Cells(18, 2) = "There is no SNMP Server associated with this device."
End If
y = 0
'VPN-ENCRYPTION Initial
If FileName = "R16-DISD-3400G-CO" Then strVPN = " VPN-Encrypt"
If WorksheetExists(FileName & strVPN) = False Then
Sheets.Add ActiveSheet
ActiveSheet.Name = FileName & strVPN
ActiveSheet.Tab.Color = tabCol
With ActiveSheet.Cells(1, 1)
.Value = "VPN-Encryption"
.Font.Bold = True
End With
End If
Set rng = Sheets(FileName).Range("A:A").find(What:="vpn")
If Not rng Is Nothing Then
y = rng.row
strVPN2 = Sheets(FileName).Cells(y, 1)
blVPN = True
Sheets(FileName & strVPN).Cells(2, 1) = Sheets(FileName).Cells(y, 1)
used = Sheets(FileName).UsedRange.Rows.Count
y = 1
Sheets(FileName & strVPN).Activate
For b = 2 To 50
Set rng = Sheets(FileName).Range("A" & y & ":A" & Sheets(FileName).UsedRange.Rows.Count).find(What:="vpn")
If Not rng Is Nothing Then
y = rng.row
strVPN2 = Sheets(FileName).Cells(y, 1)
If Sheets(FileName).Cells(y, 1) <> strVPN2 Then
If InStr(1, Sheets(FileName).Cells(y, 1), FileName) = 0 Then
Sheets(FileName & strVPN).Cells(Sheets(FileName & strVPN).UsedRange.Rows.Count + 1, 1) = Sheets(FileName).Cells(y, 1)
End If
End If
End If
Next b
End If
' If InStr(1, FileName, "VOIP") > 0 Then Stop
used = Sheets(FileName).UsedRange.Rows.Count
Set rng = Sheets(FileName).Range("A:A").find(What:="crypto")
If Not rng Is Nothing Then
y = rng.row
strVPN2 = Sheets(FileName).Cells(y, 1)
For b = Sheets(FileName & strVPN).UsedRange.Rows.Count To Sheets(FileName & strVPN).UsedRange.Rows.Count + 50
Set rng = Sheets(FileName).Range("A" & y & ":A" & used).find(What:="crypto")
If Not rng Is Nothing Then
y = rng.row
If Sheets(FileName).Cells(y, 1) <> strVPN2 Then
Sheets(FileName & strVPN).Cells(ActiveSheet.UsedRange.Rows.Count + 1, 1) = Sheets(FileName).Cells(y, 1)
strVPN2 = Sheets(FileName).Cells(y, 1)
End If
End If
Next b
End If
Do Until x > Sheets(FileName & strVPN).UsedRange.Rows.Count
Application.DisplayAlerts = False
With Sheets(FileName & strVPN).Range("A" & x & ":H" & x)
.MergeCells = True
.WrapText = True
End With
x = x + 1
Loop
Sheets(FileName & " Analysis").Cells(20, 2) = "See Appendix D"
If Sheets(FileName & strVPN).Cells(2, 1) = "" Or Sheets(FileName & strVPN).Cells(2, 1) = "There were no VPNs with this device." Then
Sheets(FileName & " Analysis").Cells(20, 2) = "See Appendix D"
Sheets(FileName & strVPN).Cells(2, 1) = "There were no VPNs with this device."
End If
y = 0
'Telnet Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="telnet")
If Not rng Is Nothing Then
Sheets(FileName & " Analysis").Cells(22, 2) = "True"
Sheets(FileName & " Analysis").Cells(22, 2).Font.Color = 255
Set rng = Nothing
Else
Sheets(FileName & " Analysis").Cells(22, 2) = "False"
End If
y = 0
'Telnet Time Out Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="Telnet Timeout")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(23, 2) = Sheets(FileName).Cells(y, 1)
Sheets(FileName & " Analysis").Cells(23, 2).Font.Color = 255
End If
y = 0
'Firewall Any Any Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="any any")
If Not rng Is Nothing Then
y = rng.row
Sheets(FileName & " Analysis").Cells(24, 2) = Trim(Sheets(FileName).Cells(y, 1))
Sheets(FileName & " Analysis").Cells(24, 2).Font.Color = 255
End If
Sheets(FileName & " Analysis").Activate
Sheets(FileName & " Analysis").Range("A:B").HorizontalAlignment = xlLeft
Sheets(FileName & " Analysis").Cells(1, 1).Select
'Access Lists Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="access-list")
If Not rng Is Nothing Then
y = rng.row
blAL = True
Sheets(FileName & " Analysis").Cells(25, 2) = "See Appendix B"
i = 1
Sheets.Add , ActiveSheet
ActiveSheet.Name = FileName & strAL
ActiveSheet.Tab.Color = tabCol
With ActiveSheet.Cells(1, 1)
.Value = "Access Lists"
.Font.Bold = True
End With
used = Sheets(FileName).UsedRange.Rows.Count
x = 2
Do Until InStr(1, Sheets(FileName).Cells(y, 1), "!") > 0
Sheets(FileName & strAL).Cells(x, 1) = Sheets(FileName).Cells(y, 1)
x = x + 1
y = y + 1
Loop
Set rng = Sheets(FileName).Range("A" & y + 1 & ":A" & Sheets(FileName).UsedRange.Rows.Count).find(What:="access-list")
If Not rng Is Nothing Then
y = rng.row
Do Until InStr(1, Sheets(FileName).Cells(y, 1), "!") > 0
Sheets(FileName & strAL).Cells(x, 1) = Sheets(FileName).Cells(y, 1)
x = x + 1
y = y + 1
Loop
End If
Else
Sheets.Add , ActiveSheet
ActiveSheet.Name = FileName & strAL
ActiveSheet.Tab.Color = tabCol
With ActiveSheet.Cells(1, 1)
.Value = "Access Lists"
.Font.Bold = True
End With
ActiveSheet.Cells(2, 1) = "There were no Access Lists listed with this device."
End If
y = 0
ActiveSheet.Range("A:A").Columns.AutoFit
Sheets(FileName & " Analysis").Activate
AL = 2
Do Until x > Sheets(FileName & strAL).UsedRange.Rows.Count
Application.DisplayAlerts = False
With Sheets(FileName & strAL).Range("A" & x & ":H" & x)
.MergeCells = True
.WrapText = True
End With
x = x + 1
Loop
'Maps Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="map")
If Not rng Is Nothing Then
y = rng.row
blMap = True
i = 1
Sheets.Add , ActiveSheet
With ActiveSheet
.Tab.Color = tabCol
.Name = FileName & " Maps"
End With
ActiveSheet.Cells(1, 1) = "Maps"
ActiveSheet.Cells(1, 1).Font.Bold = True
used = Sheets(FileName).UsedRange.Rows.Count
Do Until y > used
If InStr(1, Sheets(FileName).Cells(y, 1), "map") > 0 Then
ActiveSheet.Cells(xMap, 1) = Sheets(FileName).Cells(y, 1)
xMap = xMap + 1
End If
y = y + 1
Loop
Sheets(FileName & " Analysis").Cells(21, 2) = "See Appendix E"
used = 0
xMap = 2
Sheets(FileName & " Analysis").Activate
Else
Sheets.Add , ActiveSheet
With ActiveSheet
.Tab.Color = tabCol
.Name = FileName & " Maps"
End With
ActiveSheet.Cells(1, 1) = "Maps"
ActiveSheet.Cells(1, 1).Font.Bold = True
ActiveSheet.Cells(2, 1) = "There are no Maps on this device."
Sheets(FileName & " Analysis").Cells(21, 2) = "See Appendix E"
End If
Do Until x > Sheets(FileName & " Maps").UsedRange.Rows.Count
Application.DisplayAlerts = False
With Sheets(FileName & " Maps").Range("A" & x & ":H" & x)
.MergeCells = True
.WrapText = True
End With
x = x + 1
Loop
'VLANs Initial
' If FileName = "Brocade_6610_Switchs" Then Stop
Set rng = Sheets(FileName).Range("A:A").find(What:="vlan*name ")
If Not rng Is Nothing Then
y = rng.row
strVLAN = Sheets(FileName).Cells(y, 1)
blVLAN = True
Sheets.Add , ActiveSheet
ActiveSheet.Name = FileName & " VLANs"
ActiveSheet.Tab.Color = tabCol
With ActiveSheet.Cells(1, 1)
.Value = "VLANs"
.Font.Bold = True
End With
Sheets(FileName & " Analysis").Cells(26, 2) = "See Appendix G"
ActiveSheet.Cells(2, 1) = Sheets(FileName).Cells(y, 1)
used = Sheets(FileName).UsedRange.Rows.Count
y = y + 1
If y > 0 Then
Do Until rng Is Nothing
Set rng = Sheets(FileName).Range("A" & y & ":A" & used).find(What:="vlan*name ")
If Not rng Is Nothing Then y = rng.row
If Sheets(FileName).Cells(y, 1) <> strVLAN Then
If y <> 0 Then
ActiveSheet.Cells(ActiveSheet.UsedRange.Rows.Count + 1, 1) = Sheets(FileName).Cells(y, 1)
strVLAN = Sheets(FileName).Cells(y, 1)
End If
Else
y = y + 1
End If
Loop
y = 0
End If
Else
Sheets.Add , ActiveSheet
ActiveSheet.Name = FileName & " VLANs"
ActiveSheet.Tab.Color = tabCol
With ActiveSheet.Cells(1, 1)
.Value = "VLANs"
.Font.Bold = True
End With
Sheets(FileName & " Analysis").Cells(26, 2) = "See Appendix G"
ActiveSheet.Cells(2, 1) = "No VLANs associated with this device."
End If
'Firewall Permit Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="permit")
If Not rng Is Nothing Then
y = rng.row
Do Until y > Sheets(FileName).UsedRange.Rows.Count
If InStr(1, Sheets(FileName).Cells(y, 1), "permit seq") > 0 Then
Sheets(FileName & " Analysis").Cells(P, 3) = Sheets(FileName).Cells(y, 1)
P = P + 1
End If
y = y + 1
Loop
Else
' GoTo NextFile
End If
y = 0
P = 4
d = 4
'Firewall Deny Initial
Set rng = Sheets(FileName).Range("A:A").find(What:="deny")
If Not rng Is Nothing Then
y = rng.row
Do Until y > Sheets(FileName).UsedRange.Rows.Count
If InStr(1, Sheets(FileName).Cells(y, 1), "deny seq") > 0 Then
Sheets(FileName & " Analysis").Cells(d, 4) = Sheets(FileName).Cells(y, 1)
d = d + 1
End If
y = y + 1
Loop
End If
End Sub
Function WorksheetExists(shtName As String, Optional wb As Workbook) As Boolean
Dim sht As Worksheet
If wb Is Nothing Then Set wb = ThisWorkbook
On Error Resume Next
Set sht = wb.Sheets(shtName)
On Error GoTo 0
WorksheetExists = Not sht Is Nothing
End Function
Public Sub ColorWord(check As Range, shtName As String, row As Long, find As String)
Dim StartChar As Integer, _
LenColor As Integer
Sheets(shtName).Activate
check.Select
For i = 1 To 5
With Selection
StartChar = InStr(1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
StartChar = InStr(StartChar + 1, check.Value, find)
If StartChar = 0 Then Exit Sub
.Characters(Start:=StartChar, Length:=Len(find)).Font.Color = RGB(255, 0, 0)
End With
Next i
End Sub
Public Sub Forti()
Dim strHN, strModel, strConfig, strLog, strTelnet, strFN, strForti As String
Dim rng As Range
Set rng = Nothing
Dim wb As Workbook
Set wb = ActiveWorkbook
Dim q As Long
strFN = ActiveSheet.Name
strForti = Left(strFN, 22)
If strForti = "STARTER TAB" Then Exit Sub
ActiveSheet.Copy After:=wbMain.Sheets(Sheets.Count)
If Len(strForti & " Worksheet") <= 25 Then
strWS = " Worksheet"
ElseIf Len(strForti & " Worksht") <= 25 Then
strWS = " Worksht"
Else
strWS = " WS"
End If
If WorksheetExists(strForti & strWS, wbMain) = False Then
wbMain.Sheets.Add
ActiveSheet.Tab.Color = tabCol
ActiveSheet.Name = strForti & strWS
Else
wbMain.Sheets.Add
ActiveSheet.Tab.Color = tabCol
ActiveSheet.Name = strForti & strWS & " (2)"
End If
wbMain.Activate
'Labels
Sheets(strForti & strWS).Cells(4, 1) = "Control"
Sheets(strForti & strWS).Cells(4, 2) = "Pass / Fail"
Sheets(strForti & strWS).Cells(4, 3) = "Config Data"
Sheets(strForti & strWS).Range("A4:C4").Font.Bold = True
Sheets(strForti & strWS).Cells(5, 1) = "Hostname"
Sheets(strForti & strWS).Cells(6, 1) = "Model"
Sheets(strForti & strWS).Cells(7, 1) = "Config Version"
Sheets(strForti & strWS).Cells(8, 1) = "Clock Setting"
Sheets(strForti & strWS).Cells(9, 1) = "Logging"
Sheets(strForti & strWS).Cells(10, 1) = "Access Lists"
Sheets(strForti & strWS).Cells(11, 1) = "Telnet"
Sheets(strForti & strWS).Cells(12, 1) = "USB Auto Install"
Sheets(strForti & strWS).Cells(13, 1) = "VLANs"
'Column Widths and row freeze
Sheets(strForti & strWS).Activate
Sheets(strForti & strWS).Columns(1).ColumnWidth = 23
Sheets(strForti & strWS).Columns(2).ColumnWidth = 23
Sheets(strForti & strWS).Columns(3).ColumnWidth = 40
Sheets(strForti & strWS).Rows(5).Select
' ActiveWindow.FreezePanes = True
Sheets(strForti & strWS).Range("A4:B50").HorizontalAlignment = xlCenter
'Hostname
Set rng = Sheets(strFN).Range("A:A").find(What:="Set hostname")
If Not rng Is Nothing Then
y = rng.row
strHN = Mid(Sheets(strFN).Cells(y, 1), 19, 50)
'If Right(strHN, 1) = Chr(44) Then strHN = Left(strHN, Len(strHN) - 1)
strHN = Left(strHN, Len(strHN) - 1)
Sheets(strForti & strWS).Cells(5, 3) = strHN
End If
With Sheets(strForti & strWS).Cells(5, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
'Model
Set rng = Sheets(strFN).Range("A:A").find(What:="Set alias")
If Not rng Is Nothing Then
y = rng.row
strModel = Mid(Sheets(strFN).Cells(y, 1), 16, 50)
'If Right(strModel, 1) = Chr(44) Then strModel = Left(strModel, Len(strModel) - 1)
strModel = Left(strModel, Len(strModel) - 1)
Sheets(strForti & strWS).Cells(6, 3) = strModel
End If
With Sheets(strForti & strWS).Cells(6, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
'Config Version
Set rng = Sheets(strFN).Range("A:A").find(What:="#config-version")
If Not rng Is Nothing Then
y = rng.row
strConfig = Mid(Sheets(strFN).Cells(y, 1), 24, 5)
Sheets(strForti & strWS).Cells(7, 3) = strConfig
End If
For b = 1 To UBound(varPass)
If InStr(1, Sheets(strForti & strWS).Cells(7, 3), varPass(b)) > 0 Then
With Sheets(strForti & strWS).Cells(7, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
End If
Next b
If Sheets(strForti & strWS).Cells(7, 2) <> "Pass" Then
For b = 1 To UBound(varFail)
If InStr(1, Sheets(strForti & strWS).Cells(7, 3), varFail(b)) > 0 Then
With Sheets(strForti & strWS).Cells(7, 2)
.Font.Color = 16777215
.Interior.Color = 192
.Value = "Fail"
End With
If varFailDate(b) <> "" Then
Sheets(strForti & strWS).Cells(7, 3) = Sheets(strForti & strWS).Cells(7, 3) & Chr(10) & "Last Day of Support: " & varFailDate(b)
End If
End If
Next b
End If
'Clock Setting
Set rng = Sheets(strFN).Range("A:A").find(What:="set ntpsync enable")
If Not rng Is Nothing Then
y = rng.row
Sheets(strForti & strWS).Cells(8, 3) = "NTP Enabled"
With Sheets(strForti & strWS).Cells(8, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
Else
With Sheets(strForti & strWS).Cells(8, 2)
.Font.Color = 16777215
.Interior.Color = 192
.Value = "Fail"
End With
End If
'Logging
Set rng = Sheets(strFN).Range("A:A").find(What:="config log")
If Not rng Is Nothing Then
y = rng.row
Do Until Sheets(strFN).Cells(y, 1) = "end"
strLog = strLog & Chr(10) & Sheets(strFN).Cells(y, 1)
y = y + 1
Loop
Sheets(strForti & strWS).Cells(9, 3) = strLog
If RegExx(Sheets(strForti & strWS).Cells(9, 3)) = True Then
With Sheets(strForti & strWS).Cells(9, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
Else
With Sheets(strForti & strWS).Cells(9, 2)
.Font.Color = 16777215
.Interior.Color = 192
.Value = "Fail"
End With
Sheets(strForti & strWS).Cells(9, 3) = Sheets(strForti & strWS).Cells(9, 3) & Chr(10) & "Not logging to an external server."
Call ColorWord(Sheets(strForti & strWS).Cells(9, 3), strForti & strWS, 9, "Not logging to an external server.")
End If
Else
Sheets(strForti & strWS).Cells(9, 3) = "N/A"
With Sheets(strForti & strWS).Cells(9, 2)
.Font.Color = 16777215
.Interior.Color = 192
.Value = "Fail"
End With
End If
'Access Lists
' If InStr(1, strFN, "Genban") > 0 Then Stop
Sheets(strForti & strWS).Activate
Dim strFWP() As String
Dim strFWP2 As String
Dim varLine As Variant
Set rng = Sheets(strFN).Range("A:A").find(What:="config firewall policy")
If Not rng Is Nothing Then
y = rng.row
strFWP2 = Sheets(strFN).Cells(y, 1)
y = y + 1
Do Until InStr(1, Sheets(strFN).Cells(y, 1), "config") > 0
strFWP2 = strFWP2 & Chr(10) & Sheets(strFN).Cells(y, 1) & Chr(10)
y = y + 1
Loop
Sheets(strForti & strWS).Cells(10, 3) = strFWP2
With Sheets(strForti & strWS).Cells(10, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
If InStr(1, Sheets(strForti & strWS).Cells(10, 3), "set srcaddr " & Chr(44) & "all" & Chr(44)) > 0 Then
With Sheets(strForti & strWS).Cells(10, 2)
.Font.Color = 0
.Interior.Color = 65535
.Value = "Check"
End With
ElseIf InStr(1, Sheets(strForti & strWS).Cells(10, 3), "set dstaddr " & Chr(44) & "all" & Chr(44)) > 0 Then
With Sheets(strForti & strWS).Cells(10, 2)
.Font.Color = 0
.Interior.Color = 65535
.Value = "Check"
End With
ElseIf InStr(1, Sheets(strForti & strWS).Cells(10, 3), "set service " & Chr(44) & "all" & Chr(44)) > 0 Then
With Sheets(strForti & strWS).Cells(10, 2)
.Font.Color = 0
.Interior.Color = 65535
.Value = "Check"
End With
End If
End If
'Access Lists Appendix
ThisWorkbook.Activate
Sheets(strForti & strWS).Activate
x = 4
Do Until ActiveSheet.Cells(x, 1) = ""
x = x + 1
Loop
Sheets(strForti & strWS).Cells(x + 3, 1).Select
x = Selection.row
With Selection
.Value = "Appendix A - Access Lists"
.Font.Color = 9527094
.Font.Bold = True
.Font.Size = 16
End With
x = x + 1
Dim c As Integer
c = 4
Sheets(strForti & strWS).Cells(10, 3).Select
Selection.TextToColumns Destination:=Range("D10"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12 _
, 1), Array(13, 1), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), _
Array(19, 1), Array(20, 1), Array(21, 1), Array(22, 1), Array(23, 1), Array(24, 1), Array( _
25, 1), Array(26, 1), Array(27, 1), Array(28, 1), Array(29, 1), Array(30, 1), Array(31, 1), _
Array(32, 1), Array(33, 1), Array(34, 1), Array(35, 1), Array(36, 1), Array(37, 1), Array( _
38, 1), Array(39, 1), Array(40, 1), Array(41, 1), Array(42, 1), Array(43, 1), Array(44, 1), _
Array(45, 1), Array(46, 1), Array(47, 1), Array(48, 1), Array(49, 1), Array(50, 1), Array( _
51, 1), Array(52, 1), Array(53, 1), Array(54, 1), Array(55, 1), Array(56, 1), Array(57, 1), _
Array(58, 1), Array(59, 1), Array(60, 1), Array(61, 1), Array(62, 1), Array(63, 1), Array( _
64, 1), Array(65, 1), Array(66, 1), Array(67, 1), Array(68, 1), Array(69, 1), Array(70, 1), _
Array(71, 1), Array(72, 1), Array(73, 1)), TrailingMinusNumbers:=True
Do Until c > Sheets(strForti & strWS).UsedRange.Columns.Count
If Sheets(strForti & strWS).Cells(10, c) <> "" Then
Sheets(strForti & strWS).Cells(x, 1) = Trim(Sheets(strForti & strWS).Cells(10, c))
c = c + 1
x = x + 1
Else
c = c + 1
End If
Loop
Sheets(strForti & strWS).Range("A17:A" & x).HorizontalAlignment = xlRight
Sheets(strForti & strWS).Range("A17:A" & x).HorizontalAlignment = xlLeft
Sheets(strForti & strWS).Range("D:CD").EntireColumn.Delete
' Sheets(strForti & strWS).Cells(Selection.row, 1).Select
' Dim s As Variant
' strFWP() = Split(Sheets(strForti & strWS).Cells(10, 3), vbNewLine)
' For Each varLine In strFWP()
' Sheets(strForti & strWS).Cells(Selection.row, 1) = varLine
' Selection.row = Selection.row + 1
' Next varLine
' Sheets(strForti & strWS).Paste
Sheets(strForti & strWS).Cells(10, 3) = "See Appendix A"
'Telnet
Set rng = Sheets(strFN).Range("A:A").find(What:="TELNET")
If Not rng Is Nothing Then
y = rng.row
Sheets(strForti & strWS).Cells(11, 3) = "Telnet Enabled"
With Sheets(strForti & strWS).Cells(11, 2)
.Font.Color = 16777215
.Interior.Color = 192
.Value = "Fail"
End With
Call ColorWord(Sheets(strForti & strWS).Cells(11, 3), strForti & strWS, 11, "Telnet Enabled")
Else
Sheets(strForti & strWS).Cells(11, 3) = "No Telnet"
With Sheets(strForti & strWS).Cells(10, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
End If
'USB Auto Install
Set rng = Sheets(strFN).Range("A:A").find(What:="set auto-install-config disable")
If Not rng Is Nothing Then
y = rng.row
Sheets(strForti & strWS).Cells(12, 3) = Sheets(strForti).Cells(y, 1)
With Sheets(strForti & strWS).Cells(12, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
Else
Sheets(strForti & strWS).Cells(12, 3) = "USB Auto Runs"
With Sheets(strForti & strWS).Cells(12, 2)
.Font.Color = 16777215
.Interior.Color = 192
.Value = "Fail"
End With
Call ColorWord(Sheets(strForti & strWS).Cells(12, 3), strForti & strWS, 11, "USB Auto Runs")
End If
'VLANs
Set rng = Sheets(strFN).Range("A:A").find(What:="set vlanid")
If Not rng Is Nothing Then
y = rng.row
strVLAN = Trim(Sheets(strFN).Cells(y, 1))
Do Until rng Is Nothing
Set rng = Sheets(strFN).Range("A" & y + 2 & ":A100000").find(What:="vlanid")
If Not rng Is Nothing Then
y = rng.row
strVLAN = strVLAN & Chr(10) & Trim(Sheets(strFN).Cells(y, 1))
End If
Loop
If strVLAN <> "" Then
Sheets(strForti & strWS).Cells(13, 3) = strVLAN
With Sheets(strForti & strWS).Cells(13, 2)
.Font.Bold = True
.Interior.Color = 5287936
.Font.Color = 16777215
.Value = "Pass"
End With
End If
Else
Sheets(strForti & strWS).Cells(13, 3) = "No VLANs"
With Sheets(strForti & strWS).Cells(13, 2)
.Value = "N/A"
.Interior.Color = 14277081
End With
End If
wb.Close False
Sheets("STARTER TAB").Activate
Sheets(strForti & strWS).Activate
With Sheets(strForti & strWS).Cells(1, 1)
.Font.Color = 6299648
.Font.Bold = True
.Font.Size = 16
.Value = strFN & " Analysis"
End With
Set rng = Sheets(strForti & strWS).Range("A:A").find(What:="VLANs")
If Not rng Is Nothing Then
y = rng.row + 1
' ActiveSheet.Rows(y & ":" & y + 100).EntireRow.Delete
ActiveWorkbook.Save
End If
With Sheets(strForti & strWS).Range("A4:C" & Sheets(strForti & strWS).UsedRange.Rows.Count).Borders
.LineStyle = xlContinuous
.Color = vbBlack
.Weight = xlThin
End With
Sheets(strForti & strWS).Rows(2).Select
ActiveWindow.FreezePanes = True
End Sub
Public Function OpenWkBks(strWkBk As String)
Dim wb As Workbook
For Each wb In Workbooks
If wb.Name = strWkBk Then
OpenWkBks = True
Exit Function
Else
OpenWkBks = False
End If
Next wb
End Function