+ Reply to Thread
Results 1 to 16 of 16

Combobox to accept letters or convert figures to time

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Combobox to accept letters or convert figures to time

    Good evening folk

    I am using this code to ensure the combobox converts figures to the HH:MM format, this works very well... however I am also looking for a way for the combobox to also accept letters from a rowsource

    can anyone help with this please

    Many thanks

    JT


    Please Login or Register  to view this content.
    Last edited by JamesT1; 06-10-2019 at 02:44 AM. Reason: Solved

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,847

    Re: Combobox to accept letters or convert figures to time

    What do you mean by "letters from a rowsource"? If the user enters something other than a time, what is it, and how will you interpret it?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

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

    Re: Combobox to accept letters or convert figures to time

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

  4. #4
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Combobox to accept letters or convert figures to time

    Thanks guys

    The combobox rowsource is a named range with 2 or 3 digit codes for absences... what I'm looking for is for the user to insert the start time,, or select the code if the person is absent...

    The code above I use in other parts so the user just types in the time digits... e.g 0600 and it converts it to the time (HH:MM), 06:00,, however it doesn't work in the boxes with the codes

    Many thanks

    JT
    Last edited by JamesT1; 06-06-2019 at 01:12 PM. Reason: spelling

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

    Re: Combobox to accept letters or convert figures to time

    JT

    What's the purpose of the combobox?

    Is if for entering a start/end time?

  6. #6
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Combobox to accept letters or convert figures to time

    Hi Norie

    It is mainly for entering the time,,, and if possible record the absence code...

    Cheers

    JT

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

    Re: Combobox to accept letters or convert figures to time

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.

  8. #8
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Combobox to accept letters or convert figures to time

    Thanks Norie

    On the attached,,, the combo boxes with the absence codes,, will accept 3 or 4 digit numbers but wont convert to HH:MM. the boxes without the codes will convert the time...

    The boxes without the absence codes will not accept them..

    What I would like to do is have the boxes accept the codes and convert number digits to HH:MM

    many thanks for your help

    JT
    Attached Files Attached Files

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

    Re: Combobox to accept letters or convert figures to time

    James

    Perhaps you could use something like this to check if the user has selected an absence code rather than entering a time.
    Please Login or Register  to view this content.
    PS What do you want to happen when a user selects an absence code?

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Combobox to accept letters or convert figures to time

    Is this what you're after ?

    This is for the top right combo.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  11. #11
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Combobox to accept letters or convert figures to time

    Norie/Bakerman2

    Your are both stars,,, both version do what I need...…

    Norie,, It just needs to transfer the information to the sheet,, so taking out the message box let it do just that,, many thanks for your help,,

    Very much appreciated ,,both

    JT

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Combobox to accept letters or convert figures to time

    You're welcome and thanks for rep+.

  13. #13
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Combobox to accept letters or convert figures to time

    Norie/Bakerman2

    Many thanks for your help with this,,, its doing exactly as you guys said it would, I have come across another wee issue with it....

    When the Userform is opened after saving the time, I am looking for the text boxes to show the cell contents.. its doing this OK,, however it is changing the times from the HH:MM format and subsequently changing the cell format when its saved again

    any further help would be very much appreciated
    Attached Files Attached Files

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Combobox to accept letters or convert figures to time

    This seems to work.

    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Combobox to accept letters or convert figures to time

    bakerman 2.. once again many thanks for your help,, spot on,,, my sheet now displays everything correctly

    many thanks for your valuable assistance,, very much appreciated..

    JT

  16. #16
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Combobox to accept letters or convert figures to time

    You're welcome.

+ 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. Combobox Accept letters and convert numbers to HH:MM
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2019, 07:05 AM
  2. [SOLVED] Calculating time in Excel 2010. How to convert figures into minutes?
    By Nickitta in forum Excel General
    Replies: 7
    Last Post: 10-23-2017, 09:57 AM
  3. Password login to accept letters and numbers
    By Blokeman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2014, 01:22 PM
  4. [SOLVED] Reading the last 2 letters in a combobox value and enter those 2 letters into column
    By emilyloz in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-26-2013, 09:26 AM
  5. ComboBox Accept Choices Only?
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2009, 11:04 AM
  6. I want the input box to accept letters A-H... but how
    By Dustin S. in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-04-2009, 02:49 PM
  7. Summing figures within letters???
    By Simon Lloyd in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-14-2006, 02:21 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