Userform Identifiers not Recognized

Mango13

New Member
Joined
Aug 28, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a user form for better data entry at work. When I try to add an entry via the user form, the code fails referencing "Identifier not recognized." However, it only does this for some identifiers.

The identifiers listed below are able to be user entered with no problems. The remainder are not recognized.
Me.txtQty.Value
Me.txtDay.Value
Me.cboPart.Value
Me.cboEmp.Value

Please see below for my code.

Thanks in advance!!
_____________________________________________________
Sub cmdAdd_Click()
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Total")

'find first empty row in database
lRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1

With ws

.Cells(IRow, 2).Value = Me.txtEntBy.Value
.Cells(lRow, 3).Value = Me.txtDay.Value
.Cells(lRow, 4).Value = Me.cboEmp.Value
.Cells(lRow, 5).Value = Me.cboPart.Value
'.Cells(IRow, 6).Value = Me.txtFuel.Value
'.Cells(IRow, 7).Value = Me.txtOdS.Value
'.Cells(IRow, 8).Value = Me.txtOdE.Value
.Cells(lRow, 10).Value = Me.txtQty.Value
'.Cells(IRow, 11).Value = Me.txtDel.Value

End With

'clear the data
Me.txtEntBy.Value = ""
Me.cboPart.Value = ""
Me.cboEmp.Value = ""
Me.txtDay.Value = Format(Date, "Short Date")
Me.txtQty.Value = 1
Me.txtFuel.Value = ""
Me.txtOdS.Value = ""
Me.txtOdE.Value = ""
Me.txtDel.Value = ""
Me.cboPart.SetFocus

End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
IRow is not the same as lRow
You declared lRow
with lower case L
but in some places are using IRow with upper case I

I changed the font of this post to better show what you've posted

.Cells(IRow, 2).Value = Me.txtEntBy.Value
.Cells(lRow, 3).Value = Me.txtDay.Value
.Cells(lRow, 4).Value = Me.cboEmp.Value
.Cells(lRow, 5).Value = Me.cboPart.Value
'.Cells(IRow, 6).Value = Me.txtFuel.Value
'.Cells(IRow, 7).Value = Me.txtOdS.Value
'.Cells(IRow, 8).Value = Me.txtOdE.Value
.Cells(lRow, 10).Value = Me.txtQty.Value
'.Cells(IRow, 11).Value = Me.txtDel.Value
 
Upvote 0
You're welcome and thanks for reporting back.
With many fonts, i, l, L, 1, 0, O are tough to distinguish in the VBA editor.
Personally, I use the Consolas (Western) font,
mostly because the zero has a slash through it and can't be confused with O (upper case o)
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,243
Members
448,555
Latest member
RobertJones1986

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