+ Reply to Thread
Results 1 to 6 of 6

showing 01 instead of 1

  1. #1
    Registered User
    Join Date
    06-13-2014
    Posts
    4

    Angry showing 01 instead of 1

    hi all new to the forum and need help

    I am working in Excel right now and using vb to short out some things i have made 3 combo box's

    [hour] [min] [am/pm]

    I set a list to populate the range in the combobox

    1-12
    1-59
    am/pm

    I then am copying and pasting the "time" into a word doc ... all is working
    butttt....

    the combo box when selecting say 4:03pm shows as 4:3pm when out putting
    I have formatted the cells to show 01 02 ..etc
    and in the comboBox list it is showing as 01,02 etc
    when actually selected it drops the 0 ....




    what do help.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: showing 01 instead of 1

    When outputting the minutes value, use the FORMAT function to keep the 00 format.
    Example:
    Format(Cells(1, 1).Value, "00")

    Otherwise, show your output part of the code.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-13-2014
    Posts
    4

    Re: showing 01 instead of 1

    EX:
    Please Login or Register  to view this content.

    EVERYTHING in grouped into textbox1.text

    where it gets its data for combo boxes is in a sheet

    hourBox4.Text [ Row source List!h1:h13 cell 1 blank for if we do not know the time and wish to leav it blank upto 13 to cover all 12 digits in hour ]
    not sure where to pop in the formatting



    ~~copying all data from textbox1.text~~

    Please Login or Register  to view this content.


    sooooo VERY ugly i know but..... where do i put in format

    TIME OF WEDDING : " & hourBox4.Text & <--- in here ? " & (Format(Cells(1, 1).Value, "00") hourBox4.Text &

    ?_?

    it has been a to long..
    Last edited by Leith Ross; 06-13-2014 at 06:48 PM. Reason: Added Code tags

  4. #4
    Registered User
    Join Date
    06-13-2014
    Posts
    4

    Re: showing 01 instead of 1

    GOT IT. it is a BAD way of doing it but i am going to format the cells in the sheet as text that way 01 IS not a number but a string :D
    in this case as i am not doing math on the number them self this should work ..... pats self on back .. thanks for the input AlphaFrog


    ~_~ my code is sooo bad its not funny

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: showing 01 instead of 1

    Try this...

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-13-2014
    Posts
    4

    Re: showing 01 instead of 1

    will give it a go ^_^ ill post back of course my "bad" solution is working now sooo lol ... again thou thanks
    work day over i am out 3000 !


    post back on Monday

+ 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. Excel 2007 : UDF- not showing
    By sara_noltsis in forum Excel General
    Replies: 8
    Last Post: 04-23-2016, 10:42 AM
  2. Replies: 7
    Last Post: 07-22-2013, 11:29 AM
  3. Excel 2007 : showing .260 instead of .26
    By jimb01 in forum Excel General
    Replies: 5
    Last Post: 08-19-2011, 02:01 PM
  4. Toggle Button to Hide column A while showing B and hide B while showing A
    By glee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2011, 02:02 PM
  5. [SOLVED] Showing/ not showing "getting started" when excel starts
    By Ask in forum Excel General
    Replies: 1
    Last Post: 07-20-2005, 12:05 PM

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