This macro is looking at two cells (A8 and A10) to determine if the values are there in both cells or only one cell.
If the values are in both cells C11 get a value of 2
If the value is in only one cell C11 gets a value of 1
I do need to add a third option where if the valuse in the code below are not found in either cell C11 gets a value of 0.
The text in red in the code, shows where the error occures.
All cells on Sheet1 and PART are formatted as General. There are no extra spaces or characters in the cells where the data is being pulled from. I am stumped and I hope someone can help.
Code:' Part quantity being determined
Dim Val1 As String
Dim Val2 As String
Val1 = Sheet1.Range("A8")
Val2 = Sheet1.Range("A10")
If Val1 = "-A" Or "-B" Or "-H" _
And Val2 = "-A" Or "-B" Or "-H" Then
Sheet1.Range("C11").Value = 2
Sheets("PART").Range("B35:E35").Copy Destination:=Sheet1.Range("A11")
Else
Sheet1.Range("C11").Value = 1
End If
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgyG714V_k7odQMrTz14AaABAg. 9h740K6COOA9iHOYYpaAbC
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgxuL6YCUckeUIh9hoh4AaABAg
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwGTEyefOX7msIh1wZ4AaABAg. 9h4sd6Vs4qE9h7G-bVm8_-
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=Ugw3nF0C04AGt73H1BB4AaABAg. 9h6VhNCM-DZ9h7EqbG23kg
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwGTEyefOX7msIh1wZ4AaABAg. 9h4sd6Vs4qE9h7KvJXmK8o
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=Ugw3nF0C04AGt73H1BB4AaABAg. 9h6VhNCM-DZ9h7E1gwg4Aq
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgywFtBEpkHDuK55r214AaABAg
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg. 9h5lFRmix1R9h79hNGvJbu
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg. 9h5lFRmix1R9h79YAfa24T
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg. 9h5lFRmix1R9h79M1SYH1E
https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg. 9h5lFRmix1R9h78SxhXTnR
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA