Below is my VBA code that I have been racking my head around. I have 4 different values to compare against to get the result I want and multiple things to compare. If anyone could help me out with this, it would be great.
Public Sub cts_04_cmac_2_check()
'CTS04CSPRWY CMAC 2 Check
If (Sheet1.Range("A62") = "2.3.4/42/24/B1") And (Sheet1.Range("A63") = "2.3.4/42/1/B1") Then
Sheet1.Range("C3").Value2 = "Good"
Else
Sheet1.Range("C3").Value2 = "Invalid"
End If
'End of CTS04CSPRWY CMAC 2 Check
End Sub
In reality I would love to have or statements included:
Public Sub cts_04_cmac_2_check()
'CTS04CSPRWY CMAC 2 Check
If (Sheet1.Range("A62") = "2.3.4/42/24/B1" Or Sheet1.Range("A62") = "2.3.4/42/24/B2) And (Sheet1.Range("A63") = "2.3.4/42/1/B1" Or Sheet1.Range("A63") = "2.3.4/42/1/B2") Then
Sheet1.Range("C3").Value2 = "Good"
Else
Sheet1.Range("C3").Value2 = "Invalid"
End If
'End of CTS04CSPRWY CMAC 2 Check
End Sub
This compares 2 values to an arrays index table that changes based on a selection.
One more question is: can I continue to add additional If statements after an end if? I have about 256 checks to run through with the similar code above.
It compares these 2 Formulas:
=INDEX('Collective Node Data'!A2:AQ1048576, MATCH(I3,'Collective Node Data'!A2:A230, 0),15)
=INDEX('Collective Node Data'!A2:AQ1048576, MATCH(I3,'Collective Node Data'!A2:A230, 0),26)
enter image description here
Based off of this value
enter image description here
to get a "Good" or "Bad" in the CMTS Check Cells C3
enter image description here
question from:
https://stackoverflow.com/questions/65843557/comparing-two-cell-strings-to-print-out-good-or-bad 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…