The code I highlighted in Red was changes I tried to make that broke the code.
Before I changed it was .Range("B5"B31")
in Cell A1 on both sheets I've input B5:B31, wasn't sure if the issue was because this code runs on one sheet but looks at a range on a different sheet
The goal was to attempt to prevent someone from having to go into the vba code and change the range if that range on that sheet changes. Recently someone moved the range over from A5:A31 because it looked "Nicer", while it did look better adjusted to the right it broke the code that no one knew how to fix.
Private Function validateAircraft(acAmuIn As String) As Boolean Dim wsStatusBoard As Worksheet: Set wsStatusBoard = Sheets("Status Board") Dim wsList As Worksheet: Set wsList = Sheets("List") Dim cRng As Range Dim rRng As Range Dim lastRow As Long Dim acNumber As Integer Dim acType As Variant Dim acAmuInput() As String Dim amuName As String Dim myTableArray As Range [COLOR=#FF0000]Dim MyValue As Variant[/COLOR] [COLOR=#FF0000]MyValue = Range("A1").Value[/COLOR] acNumber = acAmuIn '' check to see if the a/c is in the 525 [COLOR=#FF0000] For Each rRng In wsStatusBoard.Range("MyValue")[/COLOR] If rRng.Value = acNumber Then '' found in 525, now check to see if there is an engine number entered For Each cRng In wsStatusBoard.Range(Cells(rRng.Row, 2).Address, Cells(rRng.Row, 5).Address) If Not IsEmpty(cRng.Value) Then '' ac belongs to 525 validateAircraft = True Exit Function Else MsgBox "Engine number not listed for select aircraft in Status Board" validateAircraft = False Exit Function End If Next cRng End If Next rRng