Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi There,
I load a combobox with my fonts but would like it to update my range "text" upon changing it ... When I "run" the sub it works!!! ... but not when I just change my selection. Private Sub ComboBox1_Change() On Error Resume Next ThisWorkbook.Sheets("Fonts").Range("Text").Font.Na me = ComboBox1.Value End Sub Anyone? Brgds Sige XL97-Sr2 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sige,
I would assume that as you are not Changing the combo box text (typing in the edit portion). Try the Click event instead. NickHK "Sige" wrote in message oups.com... Hi There, I load a combobox with my fonts but would like it to update my range "text" upon changing it ... When I "run" the sub it works!!! ... but not when I just change my selection. Private Sub ComboBox1_Change() On Error Resume Next ThisWorkbook.Sheets("Fonts").Range("Text").Font.Na me = ComboBox1.Value End Sub Anyone? Brgds Sige XL97-Sr2 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Nick,
Thanks for the advice ... I tried Click & DropButtonClick. But with the same result! (Though, here again: When running the "sub" explicitely it works like a charm) Any other possible reason? BRGDS Sige Private Sub ComboBox1_Click() On Error Resume Next Sheets("Fonts").Range("Text").Font.Name = ComboBox1.Value End Sub Private Sub ComboBox1_DropButtonClick() On Error Resume Next Sheets("Fonts").Range("Text").Font.Name = ComboBox1.Value End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sige,
Are you using the combo box from the Forms or Controls tool box ? NickHK "Sige" wrote in message ups.com... Hi Nick, Thanks for the advice ... I tried Click & DropButtonClick. But with the same result! (Though, here again: When running the "sub" explicitely it works like a charm) Any other possible reason? BRGDS Sige Private Sub ComboBox1_Click() On Error Resume Next Sheets("Fonts").Range("Text").Font.Name = ComboBox1.Value End Sub Private Sub ComboBox1_DropButtonClick() On Error Resume Next Sheets("Fonts").Range("Text").Font.Name = ComboBox1.Value End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Control Toolbox ... :o(
|
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sige,
Your code worked for me providing the parent workbook contained a worksheet named 'Fonts' and that this sheet had a range named 'Text'. Try removing the On Error Resume next line, which may be making your problem, and verify that the sheet and range names correspond *exactly* - look especially for leading or trailing spaces in the names. --- Regards, Norman "Sige" wrote in message oups.com... Hi There, I load a combobox with my fonts but would like it to update my range "text" upon changing it ... When I "run" the sub it works!!! ... but not when I just change my selection. Private Sub ComboBox1_Change() On Error Resume Next ThisWorkbook.Sheets("Fonts").Range("Text").Font.Na me = ComboBox1.Value End Sub Anyone? Brgds Sige XL97-Sr2 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sige,
Try removing the On Error Resume next line, which may be making Should be: Try removing the On Error Resume next line, which may be MASKING --- Regards, Norman "Norman Jones" wrote in message ... Hi Sige, Your code worked for me providing the parent workbook contained a worksheet named 'Fonts' and that this sheet had a range named 'Text'. Try removing the On Error Resume next line, which may be making your problem, and verify that the sheet and range names correspond *exactly* - look especially for leading or trailing spaces in the names. --- Regards, Norman "Sige" wrote in message oups.com... Hi There, I load a combobox with my fonts but would like it to update my range "text" upon changing it ... When I "run" the sub it works!!! ... but not when I just change my selection. Private Sub ComboBox1_Change() On Error Resume Next ThisWorkbook.Sheets("Fonts").Range("Text").Font.Na me = ComboBox1.Value End Sub Anyone? Brgds Sige XL97-Sr2 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Removed the On Error resume next ...
"Unable to set the property of the Font class" Am I not loading the Combo properly? .... It is an adjustment from J-Walk The Man! Sub FillFontBox() Dim FontList As CommandBarComboBox Dim i As Long Dim tempbar As CommandBar ' On Error Resume Next Set FontList = Application.CommandBars("Formatting").FindControl( Id:=1728) If FontList Is Nothing Then Set tempbar = Application.CommandBars.Add Set FontList = tempbar.Controls.Add(Id:=1728) End If On Error GoTo 0 With Sheets(1) .Range("A1").Activate .ComboBox1.Clear For i = 0 To FontList.ListCount - 1 .ComboBox1.AddItem FontList.List(i + 1) Next i .ComboBox1.Value = "Arial" End With ' Delete temp CommandBar if it exists On Error Resume Next tempbar.Delete End Sub I don't have more code than this in my wbk.... Oh lalala, let's go excelling Sige |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combobox_change event problem | Excel Programming | |||
ComboBox_Change sub runs unexpectedly | Excel Programming |