Mr_Ragweed2
Board Regular
- Joined
- Nov 11, 2022
- Messages
- 145
- Office Version
- 365
- Platform
- Windows
Hello and thanks for reading. I am missing something simple here on a conditional loop. I am first checking to see if a textbox on a userform has a number in it. If it does not, i am looping through the 5 sheets that may have the number in cell P14. Whenever i find the number i want to change the value of textbox4 to the value of the number i found. The below code has no errors, but it not returning the value. (I have made sure the value exists on one of the worksheets in a practice copy.)
What am i not including/doing wrong?
Thanks again for your time and any assistance.
What am i not including/doing wrong?
VBA Code:
'look for and capture tech id to userform
If TextBox4.Value <> "" = True Then
End If
Dim OSheets As Variant
Dim d As Variant
OSheets = Array("Sheet1", "Sheet3", "Sheet10", "Sheet12", "Sheet20")
For Each d In OSheets
If ActiveSheet.Range("P14").Value = "" Then
End If
If ActiveSheet.Range("P14").Value <> "" Then
ActiveSheet.Range("P14").Select
UserForm1_MasterSeedOrderForm.TextBox4.Value = ActiveSheet.Range("P14")
End If
Next
Thanks again for your time and any assistance.