Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default FORMATING ITEMS IN A COMBOBOX !!

Hello -

I have implemented a combobox on a form and it works great. It loads its
items from "SheetB". On "SheetB", I have formatted some of the items the
way I want but they lose that format after loading into the combobox.

What code do I use to keep the format as is when it is loaded into the
combobox?

OR, what code do I use to change the color, size, and font of some
"SPECIFIC" items (not all) in a combobox?

Any help would be appreciated.

Thanks
Jay


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default FORMATING ITEMS IN A COMBOBOX !!

hi
if you are using the rowsorce property to load the combo box, all this does
is bring the data into the combo box, not the sheet formating. you format the
combo box through the combo property box. you can set the back color, font
color, borders etc but its a all or nothing thing. you can't format each
individual item in the combobox differently regardless of how you format the
data on the sheet. sorry.

Regards
FSt1

"jay dean" wrote:

Hello -

I have implemented a combobox on a form and it works great. It loads its
items from "SheetB". On "SheetB", I have formatted some of the items the
way I want but they lose that format after loading into the combobox.

What code do I use to keep the format as is when it is loaded into the
combobox?

OR, what code do I use to change the color, size, and font of some
"SPECIFIC" items (not all) in a combobox?

Any help would be appreciated.

Thanks
Jay


*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default FORMATING ITEMS IN A COMBOBOX !!

Jay,

Following are some of the properties of the combobox that you can adjust:

Private Sub UserForm_Initialize()
Me.ComboBox1.BackColor = 1
Me.ComboBox1.Font = "Verdana"
Me.ComboBox1.Width = 100
Me.ComboBox1.Height = 100
End Sub
--
Regards,
Eddie
http://www.HelpExcel.com


"jay dean" wrote:

Hello -

I have implemented a combobox on a form and it works great. It loads its
items from "SheetB". On "SheetB", I have formatted some of the items the
way I want but they lose that format after loading into the combobox.

What code do I use to keep the format as is when it is loaded into the
combobox?

OR, what code do I use to change the color, size, and font of some
"SPECIFIC" items (not all) in a combobox?

Any help would be appreciated.

Thanks
Jay


*** Sent via Developersdex http://www.developersdex.com ***

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default FORMATING ITEMS IN A COMBOBOX !!

formatting a cell just changes the way that the cell's content appears...it
doesn't alter the content itself.

so for a date, the cell's value might appear to be 12/3/2008 but it's actual
value is 39519
when loaded to a combo box, the actual value is loaded.

what you may need to do is use the form's load procedure to load the values
rather than use the rowsource property...see the following example where i
have a table of dates range named 'MyData'

The following is the code behind the form:

Option Explicit
Private Sub UserForm_Initialize()
LoadComboDates
End Sub
Sub LoadComboDates()
Dim cell As Range
For Each cell In Range("MyData")
ComboBox1.AddItem Format(cell.Value, "dd-mmm-yy")
Next
End Sub





"jay dean" wrote in message
...
Hello -

I have implemented a combobox on a form and it works great. It loads its
items from "SheetB". On "SheetB", I have formatted some of the items the
way I want but they lose that format after loading into the combobox.

What code do I use to keep the format as is when it is loaded into the
combobox?

OR, what code do I use to change the color, size, and font of some
"SPECIFIC" items (not all) in a combobox?

Any help would be appreciated.

Thanks
Jay


*** Sent via Developersdex http://www.developersdex.com ***


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
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
Formating Text in a combobox Leith Ross[_9_] Excel Programming 0 March 16th 05 01:15 PM
how to add items to combobox Marek Excel Programming 3 August 30th 04 10:31 AM
ComboBox Items Todd Huttenstine[_2_] Excel Programming 1 December 14th 03 11:12 PM
ComboBox items Keith Willshaw Excel Programming 2 July 17th 03 11:22 AM


All times are GMT +1. The time now is 09:30 AM.

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

About Us

"It's about Microsoft Excel"