+ Reply to Thread
Results 1 to 2 of 2

UserForm TextBox/ComboBox question

  1. #1
    grasping@straws
    Guest

    UserForm TextBox/ComboBox question

    Is there any way to control the format in UserForm controls (like
    there is in cells) to accomplish a WYSIWYG setup?
    The "problem" is like this; I set up a combobox on a form to select a
    date in mm/dd/yy format - the data comes from a range of cells
    formatted to show dates ("TODAY()", TODAY+1", etc.) formatted as
    "mm/dd/yy" & the cell the selection is written to is also formatted
    the same...yet the ComboBox on the form shows the 5-digit Excel date
    code until the focus shifts off the ComboBox, then shows the form
    mm/dd/yyyy (& additionally drops preceeding zeroes) - even though the
    format is correct in the destination cell once the UserForm is closed.
    What I'm trying to avoid is confusion in the minds of some of the
    folks who will be using this workbook...not all of them are especially
    bright nor computer-literate. TIA.

    tm

  2. #2
    Bob Phillips
    Guest

    Re: UserForm TextBox/ComboBox question

    I presume that you have a link to the worksheet cells and pick up those
    values automatically. I am afraid that if you want the dates formatted, you
    will need to manually load them, something like

    With Me.Combobox1
    .AddItem ActiveSheet.Range("A1").Text
    .AddItem ActiveSheet.Range("2").Text
    'etc.
    End With

    if the worksheet dates are already formatted, or

    With Me.Combobox1
    .AddItem Format(ActiveSheet.Range("A1").Value,"mm/dd/yyyy")
    .AddItem Format(ActiveSheet.Range("A2").Value,"mm/dd/yyyy")
    'etc.
    End With

    if they are not

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "grasping@straws" <tmarlowe@stny.rr.com> wrote in message
    news:d6k00110cfvdkhbq53s5st1td1tjubaqct@4ax.com...
    > Is there any way to control the format in UserForm controls (like
    > there is in cells) to accomplish a WYSIWYG setup?
    > The "problem" is like this; I set up a combobox on a form to select a
    > date in mm/dd/yy format - the data comes from a range of cells
    > formatted to show dates ("TODAY()", TODAY+1", etc.) formatted as
    > "mm/dd/yy" & the cell the selection is written to is also formatted
    > the same...yet the ComboBox on the form shows the 5-digit Excel date
    > code until the focus shifts off the ComboBox, then shows the form
    > mm/dd/yyyy (& additionally drops preceeding zeroes) - even though the
    > format is correct in the destination cell once the UserForm is closed.
    > What I'm trying to avoid is confusion in the minds of some of the
    > folks who will be using this workbook...not all of them are especially
    > bright nor computer-literate. TIA.
    >
    > tm




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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