+ Reply to Thread
Results 1 to 4 of 4

Passing Values Between Userform Events

  1. #1
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Passing Values Between Userform Events

    Hi All,

    My proficiency with VBA is increasing, thanks to everyone in this forum. I've been having a problem, and can't seem to find any answers online. I'm using a userform and utilizing the userform events. I created an array, and am trying to pass the values from the array between the events within the same userform. One event is creating the array, and the other event is deleting the last element within the array. Below is an example of the code.

    Please Login or Register  to view this content.
    Error 13, type mismatch occurred during the UBound function within the Find method. The VBA editor is showing that UBound(Array) = "Empty". How do I pass the array elements between events within the same userform, without using excel workbooks as the intermediary? I guess I'm just trying to get more sophisticated with my code, and become less dependent on worksheet values.

    Thanks!
    Bob1980

  2. #2
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Re: Passing Values Between Userform Events

    Another note:

    I basically want to create an array, use a "Back" button feature to delete the last element of that array, delete any occurance of that last element within specified ranges within the worksheet, and add another array element after the previous element was deleted. I hope this makes sense.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Passing Values Between Userform Events

    Declare Array at the top of the userform module, outwith any sub.

    Oh, and change the name - VBA's not going to like you using Array.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    09-13-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    111

    Re: Passing Values Between Userform Events

    Thanks Norie, you're the best.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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