Macro run on list box change how to

A

ACM Home

I have a Macro that will change the colour of a connector depending on
the custom prop.wiretype

How can I have this macro run every time the list box is changed

Sub WireType()
Dim vsoShape1 As Visio.Shape
Dim intPropRow2 As Integer
Set vsoShape1 = Application.ActiveWindow.Selection(1)
intPropRow2 = 0
If vsoShape1.CellsSRC(visSectionProp, intPropRow2,
visCustPropsValue).FormulaU = """Video""" Then

Application.ActiveWindow.Selection(1).CellsSRC(visSectionObject,
visRowLine, visLineColor).FormulaU = "2"
ElseIf vsoShape1.CellsSRC(visSectionProp, intPropRow2,
visCustPropsValue).FormulaU = """Audio""" Then
Application.ActiveWindow.Selection(1).CellsSRC(visSectionObject,
visRowLine, visLineColor).FormulaU = "00"
ElseIf vsoShape1.CellsSRC(visSectionProp, intPropRow2,
visCustPropsValue).FormulaU = """Control""" Then

Application.ActiveWindow.Selection(1).CellsSRC(visSectionObject,
visRowLine, visLineColor).FormulaU = "5"
ElseIf vsoShape1.CellsSRC(visSectionProp, intPropRow2,
visCustPropsValue).FormulaU = """Tel""" Then

Application.ActiveWindow.Selection(1).CellsSRC(visSectionObject,
visRowLine, visLineColor).FormulaU = "14"
ElseIf vsoShape1.CellsSRC(visSectionProp, intPropRow2,
visCustPropsValue).FormulaU = """Data""" Then

Application.ActiveWindow.Selection(1).CellsSRC(visSectionObject,
visRowLine, visLineColor).FormulaU = "4"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top