+ Reply to Thread
Results 1 to 7 of 7

Userform error code 91

  1. #1
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Userform error code 91

    Greetings everyone!

    I have an error message that I am having a hard time getting rid of. The code is throwing the following code: "Runtime error 91. Object variable or with block variable not set." I have adapted this code for use in a project and I cannot seem to get the code to work. I would request that someone take a look at the entire code to see what I have done wrong. This code, once completed, should search G12:G. I need for all aspects of this code to work. Thanks in advance for your assistance with this!

    I have attached a sample file to illustrate the problem.

    David

  2. #2
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Userform error code 91

    sorry, I could not get attachment to work with MS edge/..
    Attached Files Attached Files

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,366

    Re: Userform error code 91

    No file attached and no code listed
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Userform error code 91

    yes, there was a slight delay in getting the file to upload. sorry... It is here now.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform error code 91

    Does this file represent your real layout and data because all of your ListBox code tells me otherwise ?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Userform error code 91

    I would like for the code to start a search with column G12, just because the project does. I know the listboxes start at A. i have\had attempted to modify numerous times, but to no avail. My goal is to use the userform to seek out a specific building type and select the appropriate one. when I select the appropriate building, the textboxes will autopopulate cells G6:L6 on the same sheet. that is my wish list... any help or guidance would be greatly appreciated!

  7. #7
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Userform error code 91

    hey guys, I spent an extra day on this and finally figured it out. more like trial and error than anything else. thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Code producing error, only on third run of Userform...?
    By RayJay01 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2019, 10:01 PM
  2. Error in userform code
    By Sanjibghosh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2017, 06:59 AM
  3. VBA userform problem with code (syntax error)
    By Odowd in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-27-2016, 09:23 PM
  4. Help with userform code looping and bringing error
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-11-2015, 06:02 AM
  5. Need someone to look over my userform code as i keep getting error 361 for no reason
    By uglymaggot in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-17-2014, 10:31 AM
  6. [SOLVED] Code Produces Error When Trying to Operate a Particular Userform after Another
    By JP777 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-29-2012, 08:04 PM
  7. UserForm Code Error
    By Mooseman60 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2010, 09:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1