Link to home
Start Free TrialLog in
Avatar of Reyesrj
ReyesrjFlag for Guam

asked on

Excel VBA, search userform

Hi all,

I have an excel VBA userform that shows employee details for about 30 employees.  The userform works fine.  I also have two buttons that goes to the previous and to the next record, this works fine too.  What I would like to add, to the userform, is a search feature like a text box.  Enter the record id number in the text box and afterupdate the information for that record id will be display.  Something like the record id entered in the search textbox will find the record id in column A and make the cell, in the worksheet, the active cell.  I can figure out the rest of the coding from here.

Another thing I want to add is a combo box, when accounting is selected, the next and previous record buttons to move through all records that have accounting in the department field.

Thank you in advance
Avatar of Neil Fleming
Neil Fleming
Flag of United Kingdom of Great Britain and Northern Ireland image

Try the attached, which I think demos what you want to do.

Demo contains a form which the button will open. There is also a code module called mForm containing some routines.

You can type a number into the search box and the form will find the corresponding ID in column A of the "data" worksheet. You can also move to next and previous records and choose an area from the dropdown, as requested.

Search box will currently only permit characters 0..9, so if your IDs are alphanumeric we will need to tweak the code.

Let me know if any of the code is unclear.
formDemo.xlsm
Is this related to the form that I provided here? If so what needs changing or adding to it?
ASKER CERTIFIED SOLUTION
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Reyesrj

ASKER

Thank you Mr. Cox!

I think you help me out in the past.  Like before, perfect!!!

Richard Reyes
Pleased to help again.
No worries at all, Roy.