+ Reply to Thread
Results 1 to 10 of 10

Unable to get the subtotal property of the worksheet function class

  1. #1
    Registered User
    Join Date
    03-02-2019
    Location
    Qatar
    MS-Off Ver
    2007
    Posts
    5

    Unable to get the subtotal property of the worksheet function class

    I'm receiving an error while executing my code.The reason i understand is when the filter of invoices submitted valued above 100k is done, lets say in this case we don't have any invoices submitted, in the system i've set it as "not delivered to customer". So, in this case how can the system take out the average days from the 2 invoices , above 100k and where both are not submitted. Screenshot of the code is below;

    Please Login or Register  to view this content.
    The error i'm receiving while executing this is "Unable to get the subtotal property of the worksheet function class". I do understand the reason for the error. Its just that, in column "d" of the main sheet (recognized in vba code as "ws_main"). In the main sheet, there's a column D. What is fed in that column is , if the delivery is not made from logistics to finance dept and obviously, unless if the delivery from logistics is not received, we cannot deliver it to customer. So, ideally if both dates are empty, then, in column D, I have kept it as, if empty, then it should write as "not delivered to customer". But our program is basicallly to take into account of the average days it takes from Delivery from Logistics to Finance (DLF) and then average days it takes from FINANCE to customer (DFC)
    But if there;'s a case of "'not delivered to customer for all invoice, how can the system get an average, which is why the error is happening. Please help
    Attached Images Attached Images
    Last edited by abraham.jeethu; 03-09-2019 at 02:58 PM. Reason: to add attachment

  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,910

    Re: Unable to get the subtotal property of the worksheet function class

    Administrative Note:
    Your post does not comply with Rule 2 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 at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    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
    Registered User
    Join Date
    03-02-2019
    Location
    Qatar
    MS-Off Ver
    2007
    Posts
    5

    Re: Unable to get the subtotal property of the worksheet function class

    Hi Ali

    I'm sorry since i was new here, i'm just getting to know through my slips. When i clicked on edit post, the Code open tag and the close tag is already there. So, do i still need to place these code tags elsewhere, apart from the codes madam?

    Jeethu

  4. #4
    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,910

    Re: Unable to get the subtotal property of the worksheet function class

    As I said, I did it for you this time.

  5. #5
    Registered User
    Join Date
    03-02-2019
    Location
    Qatar
    MS-Off Ver
    2007
    Posts
    5

    Re: Unable to get the subtotal property of the worksheet function class

    Kindly seeking somebody's support on this, Please support. Its my request

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Unable to get the subtotal property of the worksheet function class

    What do you want the average of no data to be?
    Rory

  7. #7
    Registered User
    Join Date
    03-02-2019
    Location
    Qatar
    MS-Off Ver
    2007
    Posts
    5

    Re: Unable to get the subtotal property of the worksheet function class

    Sir,

    I'd like to have the resuling figure as 0 (zero). Initially i thought we'll keep a message box stating "no invoice submitted within this range". But then i thought, i was looking for the resulting figures in a dashboard. So, obviously i would like to have the result in the dashboard within that invoice range to be ZERO, in case no invoice is delivered.

    Thank you Sir

    Jeethu

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Unable to get the subtotal property of the worksheet function class

    You can do two things. First declare your variables as Double (most of them are Variant at the moment), then uncomment the On Error Resume Next line and add On Error Goto O after the line that assigns the NDI value.

  9. #9
    Registered User
    Join Date
    03-02-2019
    Location
    Qatar
    MS-Off Ver
    2007
    Posts
    5
    Thank you for your valuable suggestion.
    Sir, i did enter the way you advised me. However, that is placing a zero there by ignoring all errors. Actually when i saw the result, it was wrong, though yes the number of days that took to deliver is also showing wrong. The reason is we have kept average ...i.e subtotal 101 for average calculation. But if there's no data for the subtotal calculation, then my suggestion was it shows 'No invoices delivered' or something numerical that helps in calculations...viz '0'

    Probably if we could do with some conditions...viz
    If criteria1 and criteria2 = "" Then...

    Place the result in ws_dasboard.Range("B6")=

    Please help

  10. #10
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Unable to get the subtotal property of the worksheet function class

    You can use logic like this and replace the 0 with whatever you want to show in each instance:

    Please Login or Register  to view this content.

+ 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] unable to get the vlookup property of the worksheet function class
    By zak.horrocks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2014, 09:35 AM
  2. unable to get the vlookup property of the worksheet function class
    By zak.horrocks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2014, 08:01 AM
  3. error 1004 unable to get the vlookup property of the worksheet function class
    By steve99g in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2013, 04:35 PM
  4. [SOLVED] unable to get the sumif property of the worksheet function class -> HELP!!!
    By stadjer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2012, 07:32 AM
  5. Run time error 1004 unable to get the vlookup property of the worksheet function class
    By surajitbose in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2012, 06:12 PM
  6. Unable to Match property of Worksheet class function
    By bambino_32 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2010, 05:38 AM
  7. Unable to get countif property of the worksheet function class
    By mikeyfear in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2008, 06:53 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