Hi, hopefully someone can help me, as I am perplexed by this.
I have a form from where I am trying to create a value for something called F** - This is basically to check if the spreadsheet has a yes or no in a certain field, if it does, then a tick will be placed in the relevant check box.
I have some data already inputted and it works fine (see below for code)
But when I try to add F21 in I get an object required failure. I have copied and pasted from the line above(F21), change to F21 or any random name and the issue still appears. Please help
Private Sub UserForm_Initialize()
OrderNumber.Value = Sheets("Customer Information").Range("E5").Value
F1.Value = Sheets("PSTN").Range("A20").Value
F2.Value = Sheets("PSTN").Range("A21").Value
F3.Value = Sheets("PSTN").Range("A22").Value
F4.Value = Sheets("PSTN").Range("A23").Value
F5.Value = Sheets("PSTN").Range("A24").Value
F6.Value = Sheets("PSTN").Range("A25").Value
F7.Value = Sheets("PSTN").Range("A26").Value
F8.Value = Sheets("PSTN").Range("A27").Value
F9.Value = Sheets("PSTN").Range("A28").Value
F10.Value = Sheets("PSTN").Range("A29").Value
F11.Value = Sheets("PSTN").Range("A30").Value
F12.Value = Sheets("PSTN").Range("A31").Value
F13.Value = Sheets("PSTN").Range("A32").Value
F14.Value = Sheets("PSTN").Range("A33").Value
F15.Value = Sheets("PSTN").Range("A34").Value
F16.Value = Sheets("PSTN").Range("A37").Value
F17.Value = Sheets("PSTN").Range("A38").Value
F18.Value = Sheets("PSTN").Range("A39").Value
F19.Value = Sheets("PSTN").Range("A40").Value
F20.Value = Sheets("PSTN").Range("A41").Value
If F1.Value = "Yes" Then
Feature1.Value = True
ElseIf F1.Value = "No" Then
Feature1.Value = False
End If
If F2.Value = "Yes" Then
Feature2.Value = True
ElseIf F2.Value = "No" Then
Feature2.Value = False
End If
If F3.Value = "Yes" Then
Feature3.Value = True
ElseIf F3.Value = "No" Then
Feature3.Value = False
End If
If F4.Value = "Yes" Then
Feature4.Value = True
ElseIf F4.Value = "No" Then
Feature4.Value = False
End If
If F5.Value = "Yes" Then
Feature5.Value = True
ElseIf F5.Value = "No" Then
Feature5.Value = False
End If
If F6.Value = "Yes" Then
Feature6.Value = True
ElseIf F6.Value = "No" Then
Feature6.Value = False
End If
If F7.Value = "Yes" Then
Feature7.Value = True
ElseIf F7.Value = "No" Then
Feature7.Value = False
End If
If F8.Value = "Yes" Then
Feature8.Value = True
ElseIf F8.Value = "No" Then
Feature8.Value = False
End If
If F9.Value = "Yes" Then
Feature9.Value = True
ElseIf F9.Value = "No" Then
Feature9.Value = False
End If
If F10.Value = "Yes" Then
Feature10.Value = True
ElseIf F10.Value = "No" Then
Feature10.Value = False
End If
If F11.Value = "Yes" Then
Feature11.Value = True
ElseIf F11.Value = "No" Then
Feature11.Value = False
End If
If F12.Value = "Yes" Then
Feature12.Value = True
ElseIf F12.Value = "No" Then
Feature12.Value = False
End If
If F13.Value = "Yes" Then
Feature13.Value = True
ElseIf F13.Value = "No" Then
Feature13.Value = False
End If
If F14.Value = "Yes" Then
Feature14.Value = True
ElseIf F14.Value = "No" Then
Feature14.Value = False
End If
If F15.Value = "Yes" Then
Feature15.Value = True
ElseIf F15.Value = "No" Then
Feature15.Value = False
End If
If F16.Value = "Yes" Then
Feature16.Value = True
ElseIf F16.Value = "No" Then
Feature16.Value = False
End If
If F17.Value = "Yes" Then
Feature17.Value = True
ElseIf F17.Value = "No" Then
Feature17.Value = False
End If
If F18.Value = "Yes" Then
Feature18.Value = True
ElseIf F18.Value = "No" Then
Feature18.Value = False
End If
If F19.Value = "Yes" Then
Feature19.Value = True
ElseIf F19.Value = "No" Then
Feature19.Value = False
End If
If F20.Value = "Yes" Then
Feature20.Value = True
ElseIf F20.Value = "No" Then
Feature20.Value = False
End If
End Sub
Bookmarks