nuttycow13
New Member
- Joined
- Feb 6, 2012
- Messages
- 47
I have been getting this error: "run-time error 438 object does not support this property or method " when trying to get a click button to search a spread sheet find a value from the entered text box and then read the cells and input them into text boxes in another userform.
this is the code i have:
Private Sub Printer_Find_Click()
If Sitebox.Value = "UKCH" Then
Sheet2.Activate
ElseIf Sitebox.Value = "SDHQ" Then
Sheet1.Activate
ElseIf Sitebox.Value = "NLEI" Then
Sheet13.Activate
ElseIf Sitebox.Value = "USHW" Then
Sheet10.Activate
ElseIf Sitebox.Value = "SGSG" Then
Sheet11.Activate
End If
Range("B1").Avtive
Do While ActiveCell.Value <> ""
If ActiveCell.Value = Find_Printer.Text Then
Found_Printer_Name.Value = Cells(0, 2).Value
Found_Vaild.Value = Cells(0, 18).Value
Found_DNS.Value = Cells(0, 14).Value
Found_IP.Value = Cells(0, 12).Value
Found_Patch.Value = Cells(0, 7).Value
Found_Fax.Value = Cells(0, 10).Value
Found_Serial.Value = Cells(0, 6).Value
Found_Model.Value = Cells(0, 5).Value
Found_Make.Value = Cells(0, 4).Value
Found_Wing.Value = Cells(0, 8).Value
Found_Mac.Value = Cells(0, 11).Value
Found_Host.Value = Cells(0, 12).Value
Found_GIS.Value = Cells(0, 17).Value
Found_Comments.Value = Cells(0, 19).Value
Found_Type.Value = Cells(0, 3).Value
Found_Location.Value = Cells(0, 9).Value
Found_Site.Value = Sitebox.Value
Found_Number.Value = Numberbox.Value
End If
ActiveCell.Offset(1, 0).Activate
Loop
Unload Me
Found_Printer.Show vbModal
End Sub
it would be great if anyone could help me. thanks in advance
this is the code i have:
Private Sub Printer_Find_Click()
If Sitebox.Value = "UKCH" Then
Sheet2.Activate
ElseIf Sitebox.Value = "SDHQ" Then
Sheet1.Activate
ElseIf Sitebox.Value = "NLEI" Then
Sheet13.Activate
ElseIf Sitebox.Value = "USHW" Then
Sheet10.Activate
ElseIf Sitebox.Value = "SGSG" Then
Sheet11.Activate
End If
Range("B1").Avtive
Do While ActiveCell.Value <> ""
If ActiveCell.Value = Find_Printer.Text Then
Found_Printer_Name.Value = Cells(0, 2).Value
Found_Vaild.Value = Cells(0, 18).Value
Found_DNS.Value = Cells(0, 14).Value
Found_IP.Value = Cells(0, 12).Value
Found_Patch.Value = Cells(0, 7).Value
Found_Fax.Value = Cells(0, 10).Value
Found_Serial.Value = Cells(0, 6).Value
Found_Model.Value = Cells(0, 5).Value
Found_Make.Value = Cells(0, 4).Value
Found_Wing.Value = Cells(0, 8).Value
Found_Mac.Value = Cells(0, 11).Value
Found_Host.Value = Cells(0, 12).Value
Found_GIS.Value = Cells(0, 17).Value
Found_Comments.Value = Cells(0, 19).Value
Found_Type.Value = Cells(0, 3).Value
Found_Location.Value = Cells(0, 9).Value
Found_Site.Value = Sitebox.Value
Found_Number.Value = Numberbox.Value
End If
ActiveCell.Offset(1, 0).Activate
Loop
Unload Me
Found_Printer.Show vbModal
End Sub
it would be great if anyone could help me. thanks in advance