Help Defining target Row

vvSTRIDEvv

Board Regular
Joined
Jun 17, 2010
Messages
74
I have a form to enter in some employee information.

Column A of the database is the employee's name, but there are 10 row gaps between each name, like..
Employee Name
John Doe



Jane Doe

The list goes all the way down the worksheet through 100's of employees.

Code:
Private Sub CommandUpdate_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("manager")

'Find Employee name in column A, and enter data to the immediate empty row below
        irow = ws.Columns("a:a").Find(Me.listemployee.Value) _
        .End(xlUp).Offset(1, 0).Row

'Enter information from the form to the correct area of the worksheet based on the found employee name
        ws.Cells(irow, 1).Value = Me.listemployee.Value
        ws.Cells(irow, 2).Value = Me.Calendar1.Value
        ws.Cells(irow, 3).Value = Me.Combo_instance.Value
        ws.Cells(irow, 9).Value = Me.txtnotes.Value

Here is where I get an object not defined error
Code:
irow = ws.Columns("a:a").Find(Me.listemployee.Value) _
        .End(xlUp).Offset(1, 0).Row

I sure help someone could help with this.
Thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
How about changing
irow = ws.Columns("a:a").Find(Me.listemployee.Value) _
.End(xlUp).Offset(1, 0).Row

to

irow = Application.Worksheetfunction.Match(Me.listemployee.value,ws.Range("a:a"),0) _
.End(xlUp).Offset(1, 0).Row
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,547
Members
452,925
Latest member
duyvmex

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