StreetSwan
New Member
- Joined
- Aug 24, 2021
- Messages
- 4
- Office Version
- 2013
- Platform
- Windows
Good Afternoon all!
I am a noob to vba and have been working on a project for work. It's basically an inspection form for our machined parts.
We measure the part with the caliper, the measurement goes into the userfrom and then gets transferred to the next empty cell in the corresponding column. It is a back and forth between the thickness and the width of the part. The code works great up until i get to 70 or so measurements in, then i get a run time error method range of object worksheet failed. I have tried everything i can think of and so far nothing has worked. Can someone please help me understand this?
I have the following code to execute:
Private Sub Enter_Click()
'Finds next empty cell and places the value in it
eRow = Measurements.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Row
Cells(eRow, 2).Value = RadialTB.Value
'Adds beep to notify inspector
Beep
'Acitvates the cell so the it will page down as necessary
Cells(eRow, 2).Activate
'Allows switching back and forth between stagnant and alternating
If StagnantCB.Value = True Then
RadialTB.Value = ""
RadialTB.SetFocus
Else
Unload Me
GrindEnter.Show (this is where the code is breaking)
End If
End Sub
I am a noob to vba and have been working on a project for work. It's basically an inspection form for our machined parts.
We measure the part with the caliper, the measurement goes into the userfrom and then gets transferred to the next empty cell in the corresponding column. It is a back and forth between the thickness and the width of the part. The code works great up until i get to 70 or so measurements in, then i get a run time error method range of object worksheet failed. I have tried everything i can think of and so far nothing has worked. Can someone please help me understand this?
I have the following code to execute:
Private Sub Enter_Click()
'Finds next empty cell and places the value in it
eRow = Measurements.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Row
Cells(eRow, 2).Value = RadialTB.Value
'Adds beep to notify inspector
Beep
'Acitvates the cell so the it will page down as necessary
Cells(eRow, 2).Activate
'Allows switching back and forth between stagnant and alternating
If StagnantCB.Value = True Then
RadialTB.Value = ""
RadialTB.SetFocus
Else
Unload Me
GrindEnter.Show (this is where the code is breaking)
End If
End Sub