Greetings,
I am trying to use the following code. What I want to happen is if value Sheet8.Range("R3").Value does not equal any number found on "Master" range A:A, then a Userform would appear. If Sheet8.Range("R3").Value does equal any number found on "Master" range A:A, then the rest of the macro would run. However, when a value that does match, I am still getting the Userform.
Sub upload_AUV_New_Values()
Application.ScreenUpdating = False
Dim j As Long
Worksheets("Master").Unprotect "1"
Sheet1LastRow = Worksheets("Master").Range("A" & Rows.Count).End(xlUp).Row
For j = 3 To Sheet1LastRow
ca = Worksheets("Master").Range("A:A").Column
If Worksheets("Master").Cells(j, ca).Value <> Sheet8.Range("R3").Value Then 'I added this part of the code
uf_AUV_RestNum_warning.StartUpPosition = 2
uf_AUV_RestNum_warning.Show
End
ElseIf Worksheets("Master").Cells(j, ca).Value = Sheet8.Range("R3").Value Then 'I am able to use this macro without adding the "does not match" portion
O = Worksheets("Master").Range("ms_AUV_Column").Column
Sheet8.Range("R4").Copy Worksheets("Master").Cells(j, O)
End If
Next j
Application.ScreenUpdating = True
End Sub
Bookmarks