Results 1 to 10 of 10

Unable to get the subtotal property of the worksheet function class

Threaded View

  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;

     ws_Main.Range("O2" & LcolMaster).AutoFilter Field:=15, Criteria1:=">100000", Operator:=xlAnd, Criteria2:="<=3000000"
        DFC = Round(Application.WorksheetFunction.Subtotal(101, ws_Main.Columns(4)), 2)
        DLF = Round(Application.WorksheetFunction.Subtotal(101, ws_Main.Columns(5)), 2)
        NIV = Application.WorksheetFunction.Subtotal(3, ws_Main.Columns(15)) - 1
        NID = Application.WorksheetFunction.Subtotal(102, ws_Main.Columns(4)) - 1
        NRDN = Application.WorksheetFunction.Subtotal(3, ws_Main.Columns(16))
        NDI = Round(Application.WorksheetFunction.Subtotal(101, ws_Main.Columns(8)), 2)
      
        ws_Dashboard.Range("B6") = DFC & " Days"
        ws_Dashboard.Range("B5") = DLF & " Days"
        ws_Dashboard.Range("B3") = NIV
        ws_Dashboard.Range("B4") = NID
        ws_Dashboard.Range("B12") = NRDN
        ws_Dashboard.Range("B8") = NDI
    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

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