+ Reply to Thread
Results 1 to 6 of 6

Sum-If formula while using UserForm

  1. #1
    Registered User
    Join Date
    11-14-2017
    Location
    Cairo,Egypt
    MS-Off Ver
    2010
    Posts
    75

    Sum-If formula while using UserForm

    Dears,

    Please I need your support, actually I don't know what's wrong I did as when I'm trying to use sum-if function in my UserForm I got wrong results (will be reflected in Textbox) comparing the right one when I do it using the same function in Excel .
    N.B I'm trying to do it while my criteria will be a (Date) which will be shown in a combobox "as a list".

    - Please check the attached UserForm sample for my inquiry.

    Thanks In advance
    Attached Files Attached Files

  2. #2
    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: Sum-If formula while using UserForm

    You need to convert the text in the list to a date, then to a number value. Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-14-2017
    Location
    Cairo,Egypt
    MS-Off Ver
    2010
    Posts
    75

    Re: Sum-If formula while using UserForm

    Quote Originally Posted by rorya View Post
    You need to convert the text in the list to a date, then to a number value. Try this:

    Please Login or Register  to view this content.
    That's why you added "1" to convert it to Number

  4. #4
    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: Sum-If formula while using UserForm

    CLng converts it to a number. The 1 is to make the date string "1 May 2018" for example, rather than just "May 2018". (it's not strictly necessary, as CDate should default to 1st of the month anyway, but I like to be explicit)

  5. #5
    Registered User
    Join Date
    11-14-2017
    Location
    Cairo,Egypt
    MS-Off Ver
    2010
    Posts
    75

    Re: Sum-If formula while using UserForm

    Many thanks rorya, for your support & effort

    Again , THANK YOU & wishing you a very successful day

  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: Sum-If formula while using UserForm

    Glad to help.

+ 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] Formula Help from UserForm
    By Faham in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-12-2015, 03:49 PM
  2. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  3. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2014, 12:28 PM
  4. [SOLVED] Open a userform from a userform, but preserve the info in the original userform
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2013, 02:38 PM
  5. userform is large.....how to use scrollbar of userform to show all of the userform
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2010, 04:11 PM
  6. Formula in a Userform
    By ssdsibes in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-16-2009, 06:00 AM
  7. [SOLVED] userform and formula
    By jeramie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2006, 07:25 AM

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