Problem with .Find function

  • I call this Sub with a Button on a UserForm on the first worksheet. The UserForm has the user type into the text field txtItemName the name of an inventory item that is listed on “Ebay Inventory.” The code runs fine until the ‘Set rgFound’ etc line. rgFound does not have the Range where the value was found. The value is in E13 of the Ebay Inventory sheet. This error message appeared: “Run Time error ‘91’. Object variable or With block variable not set. I have tried multiple things but so far no dice. Help will be appreciated

  • I have been able to adapt Leith's code to find appropriate records in the sheet. I have added a "GoTo" button, CommandButton 5. I want the "GoTo" button to send the user to the found record in the spreadsheet so user can edit the record. I've tried to send the address to a Sub that activates the found record in edit mode. So far, none of my attempts have worked. Assistance appreciated.


  • I apologize, I reread the rules just now. Clearly I am missing something. Maybe this is it. I thought I had to type CODE before and END CODE after. Now I think I see it, I have to click the </> symbol in the menu. Is that it? If it is not, please forgive my lack of experience and or receptivity and walk me through it with baby steps.

  • Just paste your code into the question and select it. Then use the <> icon in the menu.

    I've done it for you. I think a sample workbook would help us find an answer.

  • Give the user a list of product names that include what user entered in the form. When the user sees the desired product in the List Box, they can click on the Go To button the form will close and user will be taken to the record on the datasheet to edit the record.

  • This is how I would use a form

    The data is loaded into the UserFom when it initialises.

    Click on an entry in the ListBox and the delected row is copied to the TextBoxes.

    Make anychanges required then click save.

    The Sheet is updated and so is the ListBox

  • That is a better approach. I just didn't think of it. I have not used very many forms before and they were not very complicated. I will give it a go.

    Thanks for the question and the suggestion. Didn't realize the sheet would be updated as well as the ListBox.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!