Run Time error 13

Darren Smith

Well-known Member
Joined
Nov 23, 2020
Messages
631
Office Version
  1. 2019
Platform
  1. Windows
This code below says Run-time error 13 on this row
VBA Code:
Set Tb = Body_And_Vehicle_Type_Form.TextBox6.
Can some somebody say why?

VBA Code:
Sub Wing_Stay_Length()

Dim Tb As TextBox
Dim ws As Worksheet

Set ws = ThisWorkbook.Worksheets("Job Card Master")
Set Tb = Body_And_Vehicle_Type_Form.TextBox6

Select Case Tb.Value

Case ("Transit")
ws.Range("G24").Value = "550mm"

Case ("Sprinter")
ws.Range("G24").Value = "550mm"

Case ("Master")
ws.Range("G24").Value = "465mm"

Case ("Movano")
ws.Range("G24").Value = "465mm"

Case ("NV400")
ws.Range("G24").Value = "465mm"

Case ("Boxer")
ws.Range("G24").Value = "465mm"

Case ("Ducato")
ws.Range("G24").Value = "465mm"

Case ("Relay")
ws.Range("G24").Value = "465mm"

End Select

End Sub
 
set Rng1=Rng.Offset(1, 4)

Select Case Me.TextBox6.Value

Case ("Transit")
Rng1 = "550mm"

Case ("Sprinter")
Rng1 = "550mm"

Case ("Master")
Rng1= "465mm"

Case ("Movano")
Rng1= "465mm"

Case ("NV400")
Rng1 = "465mm"

Case ("Boxer")
Rng1 = "465mm"

Case ("Ducato")
Rng1 = "465mm"

Case ("Relay")
Rng1 = "465mm"

End Select
Set Rng = .FindNext(Rng)
Loop While Not Rng Is Nothing And Rng.Address <> FirstAddress
End If
Next I
End With

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
 
Upvote 0
Solution

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Sorry to waste your time.
I just added another range variable and it worked fine.
Thankyou very much for your help
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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