run-time error 438 object does not support this property or method

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
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi

When the error occurs click on the debug button and check the code line that causes the error.

If you can't find any error in that line post back, indicating which line it is.
 
Upvote 0
Sorry i thought i had made bold the error line ok i will do below:


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

Thanks
 
Upvote 0
thank you i dont know how i didnt see that looks like i have gone letter blind. i have now got problem in a different part code below:

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:B9999").Activate
Do While ActiveCell.Value <> ""
If ActiveCell.Value = Find_Printer.Text Then
Found_Printer.Found_Printer_Name.Value = Cells(0, 2).Value
Found_Printer.Found_Vaild.Value = Cells(0, 18).Value
Found_Printer.Found_DNS.Value = Cells(0, 14).Value
Found_Printer.Found_IP.Value = Cells(0, 12).Value
Found_Printer.Found_Patch.Value = Cells(0, 7).Value
Found_Printer.Found_Fax.Value = Cells(0, 10).Value
Found_Printer.Found_Serial.Value = Cells(0, 6).Value
Found_Printer.Found_Model.Value = Cells(0, 5).Value
Found_Printer.Found_Make.Value = Cells(0, 4).Value
Found_Printer.Found_Wing.Value = Cells(0, 8).Value
Found_Printer.Found_Mac.Value = Cells(0, 11).Value
Found_Printer.Found_Host.Value = Cells(0, 12).Value
Found_Printer.Found_GIS.Value = Cells(0, 17).Value
Found_Printer.Found_Comments.Value = Cells(0, 19).Value
Found_Printer.Found_Type.Value = Cells(0, 3).Value
Found_Printer.Found_Location.Value = Cells(0, 9).Value
Found_Printer.Found_Site.Value = Sitebox.Value
Found_Printer.Found_Number.Value = Numberbox.Value

End If

ActiveCell.Offset(1, 0).Activate
Loop

Found_Printer.Show vbModal

End Sub

the highlighted part is the code causing the problem cant figure out why ?
 
Upvote 0
I was just thinking could it be because i am trying to reference a textbox within another userform to read the cell and input to ?
 
Upvote 0
Can I just check?

This is the line of code causing that error?

Private Sub Printer_Find_Click()
 
Upvote 0
yep when i step through it i get to that stage and the error flags up i cant get past this stage. which seems weird right ?
 
Upvote 0

Forum statistics

Threads
1,214,970
Messages
6,122,514
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top