+ Reply to Thread
Results 1 to 4 of 4

this function only works for 2 out of 3 of my stocks

  1. #1
    Registered User
    Join Date
    05-28-2022
    Location
    Sydney
    MS-Off Ver
    microsoft 365
    Posts
    1

    this function only works for 2 out of 3 of my stocks

    Please Login or Register  to view this content.
    Last edited by AliGW; 05-28-2022 at 04:20 AM. Reason: Code tags added.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: this function only works for 2 out of 3 of my stocks

    Welcome to the forum.

    Please don't just dump a whole load of code into a post and expect someone to be able to help you without a clear explanation of the issue.

    Administrative Note:

    You need to include code tags around your code.

    Please take a moment to add the tags. 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, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then 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

    (Note: this change is not optional. As you are new here I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: this function only works for 2 out of 3 of my stocks

    I will agree with AliGW, we cannot help debug this without some detail about what "works" and "does not work" mean.

    I will add, though, that a big part (half??) of programming is debugging. Are you familiar with VBA's debugging tools (quick tutorial here: http://www.cpearson.com/excel/DebuggingVBA.aspx?em_x=22 )? I find that one of the first things I will do with something like this (whether my own code or someone else's) is to put a Stop statement or breakpoint at the top of the function (and, as debugging goes on, elsewhere in the function procedure) so VBA can enter debug mode and I can debug the procedure. The basic idea of debugging is to execute the procedure one statement at a time and identify which statements are doing something unexpected. Then figure out why the logic of that statement is incorrect and come up with a new statement that is correct.

    Hopefully that will help get you started debugging on your own.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: this function only works for 2 out of 3 of my stocks

    I suggest uploading a sample file and explaining in step by step detail...ignoring your code...what it is you are wanting to achieve...Showing a before | after scenario...
    99% of the time, a simplified solution can be offered...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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. [SOLVED] Index function works in the first row but not the others
    By mehmetics in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2018, 12:39 PM
  2. Why this function not works
    By gargigargi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2016, 09:47 AM
  3. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  4. Function works in one worksheet but not another
    By KCFractal in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2012, 08:20 PM
  5. .Find sub works but not function
    By mattflow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2010, 03:07 PM
  6. Function for top 10 list, Mode function works for first and then?
    By Imiel in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-31-2007, 06:50 AM
  7. Creating a Macros function but co9ntent of function only works in a sub plz help
    By Alexandre Brisebois (www.pointnetsolutions.com) in forum Excel General
    Replies: 6
    Last Post: 07-20-2005, 04:05 PM

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