+ Reply to Thread
Results 1 to 3 of 3

calling functions

  1. #1
    Registered User
    Join Date
    09-13-2011
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    9

    calling functions

    I'm trying to write a function that can be called by other functions, but i'm having trouble passing variables to it the orderStuff function would be called by many different command buttons. I need to pass the Tag property of the command button to the orderStuff Function. The itemLoc variable in orderStuff, never contains the value of the Tag property from the command button.

    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Last edited by stevedomer; 09-15-2011 at 07:48 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: calling functions

    Hello stevedomer,

    Welcome to the Forum!

    I have modified your code to pass the itemLoc from the CommandButton to the orderStuff function. However, I do not see any code where you assign anything the CommandButton1's Tag property.
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-13-2011
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: calling functions

    Thanks Leith,

    the Tag is static for each command button, so i set it in the properties pane.

    i did have to change Private Sub orderStuff(ByVal itemLoc As String) to Integer instead of String, otherwise i got an Unable to get the VLookup Property of the Worksheet Function Class.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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