Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Combo Box code

My app is not working stable I suspect the following code
I'm using for combobox.

Private Sub ComboBox1_Change()

On Error GoTo ComboBox1_Change_Err
Me.ComboBox1.ListFillRange = "R3:R97"
With Worksheets("Legend").Range("a3:a448")
.Borders.LineStyle = xlLineStyleNone
.Borders.ColorIndex = 2
.Borders.Weight = xlThin
Set c = .Find(ComboBox1.Value,
LookIn:=xlValues)

c.Borders.LineStyle = xlDouble
c.Borders.Weight = xlThick
c.Borders.Color = RGB(255, 0, 0)
c.Activate

End With
Application.ScreenUpdating = True


ComboBox1_Change_exit:
Exit Sub
ComboBox1_Change_Err:
MsgBox Error
Resume ComboBox1_Change_exit

End Sub

Could anybody look at this and say whether it's Ok to be
used for combobox?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Combo Box code

Might help to know how it is not working.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Alex" wrote in message
...
My app is not working stable I suspect the following code
I'm using for combobox.

Private Sub ComboBox1_Change()

On Error GoTo ComboBox1_Change_Err
Me.ComboBox1.ListFillRange = "R3:R97"
With Worksheets("Legend").Range("a3:a448")
.Borders.LineStyle = xlLineStyleNone
.Borders.ColorIndex = 2
.Borders.Weight = xlThin
Set c = .Find(ComboBox1.Value,
LookIn:=xlValues)

c.Borders.LineStyle = xlDouble
c.Borders.Weight = xlThick
c.Borders.Color = RGB(255, 0, 0)
c.Activate

End With
Application.ScreenUpdating = True


ComboBox1_Change_exit:
Exit Sub
ComboBox1_Change_Err:
MsgBox Error
Resume ComboBox1_Change_exit

End Sub

Could anybody look at this and say whether it's Ok to be
used for combobox?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Combo Box code

Sometimes, I'm getting an empty combobox.

-----Original Message-----
Might help to know how it is not working.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Alex" wrote in

message
...
My app is not working stable I suspect the following

code
I'm using for combobox.

Private Sub ComboBox1_Change()

On Error GoTo ComboBox1_Change_Err
Me.ComboBox1.ListFillRange = "R3:R97"
With Worksheets("Legend").Range("a3:a448")
.Borders.LineStyle = xlLineStyleNone
.Borders.ColorIndex = 2
.Borders.Weight = xlThin
Set c = .Find(ComboBox1.Value,
LookIn:=xlValues)

c.Borders.LineStyle = xlDouble
c.Borders.Weight = xlThick
c.Borders.Color = RGB(255, 0, 0)
c.Activate

End With
Application.ScreenUpdating = True


ComboBox1_Change_exit:
Exit Sub
ComboBox1_Change_Err:
MsgBox Error
Resume ComboBox1_Change_exit

End Sub

Could anybody look at this and say whether it's Ok to be
used for combobox?

Thanks




.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Combo Box code

Could it be that different sheets are being activated and the line
Me.ComboBox1.ListFillRange = "R3:R97"
would sometimes refer to a blank range?

This seems superfluous, just set it in design, or in the form activate, not
in every combo change.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Alex" wrote in message
...
Sometimes, I'm getting an empty combobox.

-----Original Message-----
Might help to know how it is not working.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Alex" wrote in

message
...
My app is not working stable I suspect the following

code
I'm using for combobox.

Private Sub ComboBox1_Change()

On Error GoTo ComboBox1_Change_Err
Me.ComboBox1.ListFillRange = "R3:R97"
With Worksheets("Legend").Range("a3:a448")
.Borders.LineStyle = xlLineStyleNone
.Borders.ColorIndex = 2
.Borders.Weight = xlThin
Set c = .Find(ComboBox1.Value,
LookIn:=xlValues)

c.Borders.LineStyle = xlDouble
c.Borders.Weight = xlThick
c.Borders.Color = RGB(255, 0, 0)
c.Activate

End With
Application.ScreenUpdating = True


ComboBox1_Change_exit:
Exit Sub
ComboBox1_Change_Err:
MsgBox Error
Resume ComboBox1_Change_exit

End Sub

Could anybody look at this and say whether it's Ok to be
used for combobox?

Thanks




.



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
Combo Box Code Neil Pearce Excel Discussion (Misc queries) 3 January 5th 09 04:20 PM
Drop down or Combo Box Help with VBA code and formula [email protected] Excel Worksheet Functions 4 July 17th 07 03:03 PM
combo box on change code frendabrenda1 Excel Discussion (Misc queries) 0 April 10th 06 04:21 PM
Combo Box Code jd815 Excel Discussion (Misc queries) 1 September 14th 05 08:53 PM
Help with Combo Box code Ruan[_3_] Excel Programming 4 November 19th 03 06:49 AM


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