Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
grasping@straws
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM
2 part question on averaging Geo Excel Discussion (Misc queries) 4 January 2nd 05 10:35 PM
Link Question grits75 Excel Worksheet Functions 2 December 28th 04 01:03 PM
Interest Accrual Question Kent Excel Discussion (Misc queries) 1 December 23rd 04 10:39 PM
test for date in column question Buster Excel Worksheet Functions 1 December 10th 04 04:38 AM


All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"