+ Reply to Thread
Results 1 to 12 of 12

Combobox Time Entry results in wrong calculations

  1. #1
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Combobox Time Entry results in wrong calculations

    Hi,

    I currently have a userform where the user selects a series of time values from a combo box drop down:

    Please Login or Register  to view this content.
    Timelist refers to the names range I have for the times that can be selected.

    I then use the following code to display the times correctly in the combo box instead of numerical values:

    Please Login or Register  to view this content.
    The problem I am having is that once the values are entered and the cells populated after submission, cells referring to the newly created time cells are not calculating properly. I'm not sure if this a formatting issue or a problem with my formulas.

    Thanks!

    M

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Combobox Time Entry results in wrong calculations

    Do you actually have:"h:nn AM/PM" instead of "h:mm AM/PM"?
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Combobox Time Entry results in wrong calculations

    Yea I used this: http://www.excel-pratique.com/en/vba...ate_format.php

    I tried with mm and it wasn't working either.

  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: Combobox Time Entry results in wrong calculations

    How are you populating the cells?
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Combobox Time Entry results in wrong calculations

    I have a separate set of checkboxes on the userform where the user can select days of the week to apply the entered time schedule:

    Please Login or Register  to view this content.
    This is repeated for each day of the week

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Combobox Time Entry results in wrong calculations

    I would think you'd need something like:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Combobox Time Entry results in wrong calculations

    Quote Originally Posted by TMS View Post
    I would think you'd need something like:

    Please Login or Register  to view this content.

    Regards, TMS
    This gives me a type mismatch error

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Combobox Time Entry results in wrong calculations

    Please post a sample workbook.

  9. #9
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Combobox Time Entry results in wrong calculations

    Changed my combobox code to:

    Please Login or Register  to view this content.
    Based on this information http://www.mrexcel.com/forum/excel-q...-combobox.html
    The formulas referencing these cells still aren't calculating though. Sometimes if I double click on the cell and click somewhere else on the spreadsheet the formula will calculate. So weird........

  10. #10
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Combobox Time Entry results in wrong calculations

    I think it has something to do with the cell formatting....

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

    Re: Combobox Time Entry results in wrong calculations

    It could also be something to do with how you are putting the values from the userform into the cells on the worksheet.

  12. #12
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Combobox Time Entry results in wrong calculations

    HAHA! Great Success.

    https://www.youtube.com/watch?v=IlG5sTV50Yw

    Fixed it by adding .Value, you were correct!

    Please Login or Register  to view this content.
    Thanks!

+ 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. Retrieving results and FORECAST function - the results are wrong!
    By Lucky_G in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-03-2014, 10:57 AM
  2. Vba help needed to check date and time entry and correct if wrong
    By markharris2004 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2014, 05:06 PM
  3. Replies: 2
    Last Post: 10-19-2012, 10:16 AM
  4. why the results of my calculations in excel wrong ??
    By atcp15 in forum Excel General
    Replies: 2
    Last Post: 10-09-2012, 08:30 AM
  5. coding textbox results & combobox remove blank entry
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-02-2009, 12:41 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