+ Reply to Thread
Results 1 to 10 of 10

Spinner Button and time change

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Spinner Button and time change

    Hi Guys,

    i want to connect spinner button from activex controls with cell and change time there.

    What i try is :

    Please Login or Register  to view this content.
    but not working...

    What i need is time format in HH:MM in 24 hours format (so 13.00 14.00 etc. included also)
    max is 23:59 and min is 0:00

    Can anybody help?

    Jacek
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Spinner Button and time change

    Not quite sure what you want.
    Maybe try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Spinner Button and time change

    thank you Bo_Ry!!

    Hmm
    It is increasing Hours, but not touching minutes.
    I would like to increase minutes from 00:00 like:
    00:01
    00:02
    00:03
    00:04

    until 00:59 and next one would be 01:00 (we have 1 hour).

    Hope i explained well...

    Thank you!
    Jacek

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Spinner Button and time change

    If you want a minute added to the time then just add a minute.

    if F8 has te time value

    Please Login or Register  to view this content.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Spinner Button and time change

    Try

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Spinner Button and time change

    thank you!

    Working like a charm but without one exception.
    Code:

    Please Login or Register  to view this content.
    when i have spin down property --> working fine.

    But when i am on 23:59 and clicking Up arrow --> time is changed to date and cell format is broken.
    I tried to use on error resume next but it failed.

    Can you advise please?
    Jacek
    Attached Files Attached Files

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Spinner Button and time change

    Probably changing the cell format but then it keeps on adding the hours
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Spinner Button and time change

    Please Login or Register  to view this content.
    thisi s working without any issues! thanks!

    Please Login or Register  to view this content.
    I can not do this.
    I tried with code to avoide cell formatting:

    Please Login or Register  to view this content.
    But it looks ugly so i will keep to Bo_Ry method.

    Bo_Ry can you please explain how your function is working?
    I would like to understnad this.

    Jacek

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Spinner Button and time change

    Time is a decimal part of a number. https://www.excel-easy.com/examples/...e-formats.html
    MOD function for keep remainder. https://support.microsoft.com/en-us/...rs=en-US&ad=US
    MOD(xx, 1) is the remainder of 1 which is a decimal part and also time.

  10. #10
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Spinner Button and time change

    thank you very much!

    Jacek

+ 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] Control font size with spinner button
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-06-2016, 04:45 PM
  2. Looking for solution: Combined spinner button to listbox (2 columns)
    By DavidRoger in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2013, 10:55 PM
  3. Spinner Button to Scroll Document
    By excelinator in forum Excel General
    Replies: 1
    Last Post: 05-19-2010, 03:51 PM
  4. Spinner Button - Excel 2000
    By KenSBrantford in forum Excel General
    Replies: 1
    Last Post: 12-01-2005, 03:10 PM
  5. linking spinner and button entries
    By BG in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-27-2005, 04:05 PM
  6. Spinner Button - Incremental Change
    By Anauna in forum Excel General
    Replies: 1
    Last Post: 07-06-2005, 03:05 PM
  7. [SOLVED] Spinner Button Reset
    By Anauna in forum Excel General
    Replies: 6
    Last Post: 06-30-2005, 09:05 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