Consulting

Results 1 to 4 of 4

Thread: copied userform error

  1. #1
    VBAX Newbie
    Joined
    May 2016
    Posts
    5
    Location

    copied userform error

    Hello!


    I developed a userform in a 'scrapbook' version of a primary/live workbook and it works wonderfully. A command button on one of the worksheets calls the form with the following:

    Private Sub GoShopping_Click()
    GrocerySelect.Show
    End Sub

    No error is encountered. All systems are go.

    I copied the userform to the live version of the workbook (drag and drop). I also copied the command button to the same worksheet in the live version. The code is exactly the same:
    Private Sub GoShopping_Click()
    GrocerySelect.Show
    End Sub


    When I try to use the button in the live version, however, the following error gets thrown:

    run time error 1004
    method 'range' of object'_Worksheet' failed

    and going to 'Debug' from the error window, the following line is highlighted:
    GrocerySelect.Show


    I can't figure out why the copied version to the live workbook doesn't work/what I need to change so that it does. I would greatly appreciate help on this!

    Thank you!

  2. #2
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    Please use codetags around VBA code.

    Please show the whole code that is being controlled by/in the userform.

  3. #3
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Have you checked that the drag and drop didn't change the name of the userform?

  4. #4
    VBAX Newbie
    Joined
    May 2016
    Posts
    5
    Location

    Re; your question

    Quote Originally Posted by mikerickson View Post
    Have you checked that the drag and drop didn't change the name of the userform?
    There is a very good reason you are a guru and I am a novice .... the userform got renamed. It has since been changed and works wonderfully. Thanks so much for your time!

Tags for this Thread

Posting Permissions

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