+ Reply to Thread
Results 1 to 6 of 6

Function not Appearing in Macro List

  1. #1
    Registered User
    Join Date
    07-07-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    30

    Function not Appearing in Macro List

    Hi,

    I have a function that I am trying to run, however, it is not showing up on my Macro List. I have other Macros that are Subs showing up on my Macro List but no Functions. I have tried adding a Sub End Sub on either end of my Function but then the Macro wont get past the first line. The function looks like this:

    Function flag_duplicates()
    Dim value1 As Integer
    Dim value2 As Integer
    Dim toolid1 As String
    Dim toolid2 As String
    Dim Sum1 As String
    Dim Sum2 As String
    Total_VALUE = value1 + value2
    If Total_VALUE = 0 Then
    If id1 = id2 And product1 = product2 Then
    flag_duplicates = "DUPLICATE"
    Else
    flag_duplicates = "--"
    End Function

    Thanks,
    Justin

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Function not Appearing in Macro List

    Why do you need it to show up on list? you usually call them within another sub, or in a cell formula, not assign them to a button? (I am guessing you want to assign it to some object since you have a list. What happens to the value of flag_duplicates afterwards?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    07-07-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    30

    Re: Function not Appearing in Macro List

    When I try to Assign the function to a Sub it will appear on the macro list but Excel will not allow me to hit the "Run" button. I want this Function to input "Duplicate" in the far right column for any rows containging duplicate values in both column A and Column B.

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

    Re: Function not Appearing in Macro List

    What is the function meant to do?

    In it you declare and refer to a bunch of variables but those variables are never given values in the posted code.

    Also, you don't normally 'run' functions, they are usually used to return values.
    If posting code please use code tags, see here.

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Function not Appearing in Macro List

    Hclax, what values is your function supposed to compare? Something is missing....

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Function not Appearing in Macro List

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Functions are not procedures and won't be listed in the macros window. You'll only see them in the function list when you type the name prefaced with an =.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. VBA to list files not appearing in column
    By dagsvic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2013, 06:28 AM
  2. [SOLVED] Argument List of UDF not Appearing in Cell
    By jdmcheme in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2013, 11:46 AM
  3. [SOLVED] Add-in Menu List not appearing in add-in tab
    By abdulgafoor2007 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-17-2012, 09:22 AM
  4. Replies: 2
    Last Post: 08-01-2012, 01:24 PM
  5. Data Validation - Dropdown List Not Appearing
    By MWS in forum Excel General
    Replies: 2
    Last Post: 04-25-2005, 01:06 PM

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