+ Reply to Thread
Results 1 to 5 of 5

Passing on a Variable Initialized on an UF

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Passing on a Variable Initialized on an UF

    Hello all,

    How do I use the result of i (i.e. value = 4) in below example in a change event on the same UF?
    The example below gives me the following error: "application-defined or object-defined error"

    Please Login or Register  to view this content.

  2. #2
    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,617

    Re: Passing on a Variable Initialized on an UF

    You'd need to make i a global variable.

    Please Login or Register  to view this content.

    Regards, TMS
    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


  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Passing on a Variable Initialized on an UF

    1) how and where is variable i defined (shall be public variable in general module or may be in the form code)
    2) are you sure that shape name is like 122 or more (to get your 4?)
    general suggestion - set breakpoint at i= and after code stops here go step by step (F8) and observe how variable(s) values change
    Best Regards,

    Kaper

  4. #4
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Re: Passing on a Variable Initialized on an UF

    Thanks guys, the global variable solved the problem!

  5. #5
    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,617

    Re: Passing on a Variable Initialized on an UF

    You're welcome. Thanks for the rep.

+ 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. Passing Variable from one sub to another
    By bbmak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-27-2014, 12:39 PM
  2. passing variable name...
    By zara_toustra in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2013, 01:15 PM
  3. Passing a variable from one sub to another sub
    By NRMDU in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 04:45 PM
  4. passing variable?
    By leroiv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2008, 10:52 AM
  5. [SOLVED] Passing variable to VarType of other Variable
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2005, 10:06 AM

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