Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Combobox_change does not repond?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Combobox_change does not repond?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Combobox_change does not repond?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Combobox_change does not repond?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Combobox_change does not repond?

Control Toolbox ... :o(



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Combobox_change does not repond?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Combobox_change does not repond?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Combobox_change does not repond?

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
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_change event problem Shawn G.[_2_] Excel Programming 2 August 18th 05 01:37 PM
ComboBox_Change sub runs unexpectedly ChrisHouchin Excel Programming 0 May 25th 04 07:21 PM


All times are GMT +1. The time now is 10:20 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"