Macro run on list box change how to

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

0
kurt.acm (4)
11/14/2006 1:15:53 AM
visio 3638 articles. 1 followers. Follow

0 Replies
694 Views

Similar Articles

[PageSpeed] 34

Reply:

Similar Artilces:

Macro help #12
Hi, I am working on a macro in Excel 2003 Pro, and everytime I go to sort a column of data. There are about 10 rows of data in about 200+ columns. I can only get the macro to sort the column that I edited it with. How can I create the macro, so each time I click on the first row of each column, click the macro button I will assign to the toolbar, then that row will be sorted, and do this for each column? Any help at all would be greatly appreciated, Jeff Garrett (user_jeff@hotmail.com) Hi Jeff please post your current code and then we can suggest changes to it. Cheers JulieD "...

DDP (Drop down Box)
i have a front sheet that has data input onto it, this then feeds into sheets Monday thru Sunday, I would like to print data on occassions and have decided to creat a form for this option, what i dont want to do is allow users access to the data on the pages then print, am looking for a safe way to do this and decided a form, drop down box, selecting the day of the week to be printed and this would print the required data, Any idea of the code for example, Selecting Monday in the Drop down box, would then print the Sheet "Mon" Tuesday in DDB would then print "Tue" and s...

Failed to customize the dialog box of toolbar
I cannot fill the left-hand list box of toolbar's dialog box,and if I delete one button in toolbar,I lost it. Below is my code: [code] #include <windows.h> #include <commctrl.h> #include "resource.h" #define ID_TOOLBAR 20001 static char *szAppName = "Study Toolbar" ; LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ) ; TBBUTTON tbButtons[] = { {STD_FILENEW, IDM_FILE_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON | BTNS_SHOWTEXT, 0, 0}, // 1 {STD_FILEOPEN, IDM_FILE_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, // 2 {STD_FILESAVE, IDM_FILE_SAVE, TBSTATE...

Add a specific Record to a Table based on a check box
I have a Table called ServiceTypes. Based on a User's input on a ProposalForm, ServiceTypes need to be added to a ProposalServicesTable. For instance, I have a Check Box on the ProposalForm. When a Check Box is clicked Yes, Access must search the ServiceTypes Table, select a specific ServiceTypeID, and add the ServiceType to the ProposalServicesTable. How can I add the proper Service record from the ServiceTable to the ProposalServicesTable based on the Check Box? I wouldn't do it that way. I'd use a listbox (with multi-select set to YES) that was sourced to the ServiceTab...

Excel 2007 Need to permanently change Normal settings for gridlines
I am using Excel 2007 for the first time and find the gridlines delineating the cells are so faint as to be nearly indistinguishable. I can go into the cell formatting and modify the normal style, and it is just the way I want it. But I can't find a way to make Excel remember this and treat it as the new definition of the Normal style. I don't want to have to redefine Normal every time I open a new spreadsheet. Someone please help! Regards Leonard Priestley The changes you describe are changing the Border color and NOT gridlines. Go into Excel Options and cl...

Changing which database Business Portal points to
If I install Business Portal 2.5 (GP) and point it to our Great Plains development server with an old Dynamics database, once we decide to take it live, how do I go back and point it to the live Great Plains server? Is this something that can only be done during the installation? Let me preface my response by saying I only have experience with BP 3.0.... In BP 3.0 several tables are created in the Dynamics database to support the various BP functions. Unless you plan to move or copy those tables you will probably have to reinstall BP 2.5 in order to have them created. Our attempt to cop...

Message "class not registered" opening sheet with macros Excel 97
I have created a document with Macros and is password protected. I have sent it to several people who are able to use it - the one who can't is using Excel 97 SP2. They are getting error message "class not registered" - could it be the version they are using and how do I make sure they are able to use it. This could simply be a version issue if you developed on a later version and used controls from that versions object libraries. You should always use the lowest version to develop on. If this is not the case look in the VBE on the faulty machine and check tools>ref...

Macros #50
How do I move macros from one computer to another? In the VBA editor, right click on the sheet name or module name (in the left panel)that contains the macro and click on "Export File" -- Regards, Dave "Neal" wrote: > How do I move macros from one computer to another? Macros are always stored in workbooks, so you can simply copy the workbook containing the macros from one machine to another. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Neal" <Neal@discussions.microsoft.com> wrote in mess...

SMTP address list
Does anyone know of a way to obtain a list of all SMTP email addresses accepted by a server and the corresponding user account in Exchange 2003? Thanks Brad Palmer You can use LDIFDE to dump Active Directory attributes to a text file. The email addresses are held in the 'proxyAddresses' attribute, so: ldifde -f dump.ldf -l proxyaddresses This will give you a file called dump.ldf containing your addresses. You can add other Active Directory attributes to the export file as you see fit. -- Neil Hobson Exchange MVP For Exchange news, links, and tips, check: http://www.msexc...

Made two versions; both run very slow . Any spare nitro around
I've been recording some macros to append together, but put the following together by writting it (well in my case it's a bitsa from all the good code on this site). However, it runs very slow. Every 3 letter code in cells down column("K") needs to be checked to see if the same is found down column("A"). As a check, I've just been putting a "1" in the same row in column("N"). Latter columns("K:N") can then be sorted on column("N"). Column("A") has 3 letter codes from row 3 to 1402 (but changes each run). Colu...

Changing Titles by a formula
From cell A1:A10 I have standard titles that are linked to another sheet. I only need to change the office and date per each title. Is thier a way to do that making the office and date a formula in another cell? example of title ABC Comp, Office 38L Sales as of 6/07/2004 I need to only keep changeing the 38L and date. Any suggestions----Thanks Say Office # is in Column 'C' in cell A1: ="ABC Comp, Office "&C1&" Sales as of "&Today() ----- Heather wrote: ----- From cell A1:A10 I have standard titles that are linked to ...

Print Macro #2
Trying to write a macro to print a spreadsheet where the number of rows of data varies. What's wrong with this code? Dim rng As Range Set rng = Range("A1").End(xlDown).End(xlToRight) With ActiveSheet.PageSetup .PrintArea = rng End With Thank you. Pam Hi Pam Leave your PrintArea empty Excel will print all cells with a value on the sheet -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Pam" <gasp0225@juno.com> wrote in message news:16e401c38521$a7d25420$3501280a@phx.gbl... > Trying to write a macro to ...

problem in changing the text of sentences before tables
I am developing a word automation application. In a method of mine, I change the text of some sentences of an opened word file, but the problem is when I change the text of a sentence which located before a table, it will be moved to the first cell of the table. My code is as follow: void myMethod( long startingSentenceNumber, const char *toBeSearched, const char *replacement, bool replace ) { Range currentSentenceRange; Selection sentenceSelection; Sentences sentencesList = m_document.GetSentences(); long sentencesCount = sentencesList.GetCount(); CString replacementCStr(...

Using paste in macro but with variable references.
Hi all, I am trying to use the paste function in a macro but it needs to be variable. I have split a list of data (team workloads) into the seperate teams and by days of the week. I now need the macro to compile one book with all the data in order. The headings for each team are already set on a worksheet so the data needs to be entered under each heading For example: Team A Day 1 under the heading "Team A Day 1", Team B Day 1 under the next heading on the same sheet "Team B Day 1". I hit problems as the workload ammount will alter from week to week. So of course asking...

can't change/delete bills and deposits
suddenly one day i realized that when i tried to change a bill, i could click "ok" but nothing would happen. I thought it was because i upgraded to 2004, so i deleted the bills and rescheduled. about 5 of the bills will not delete either. the error message is: "Money could not write to your Money file. The operation could not be performed or another application finished this task before you. Please try again." Now some of the newly scheduled bills will not allow me to change the properties, i click ok but nothing happens when i edit the series. I have repaired ...

Outlook 2007: When i Save a New Rule outlook Change it automatically...
Hi people! I have this problem with Outlook 2007. I have 15 e-mails addresses in my outlook, but i can=B4t create the rules for send all the received mails to each emails folder. Example: I want to create a simple rule that move all the e-mail that i get from "example1@example1.com" to the folder "Inbox/ example1@example1.com". When i create the rule, all works fine, i select the correct e-mail account name, the correct destination folder, etc... but when I hit the SAVE button in rules window, Outlook 2007 changes the account automatically to another one. Not automatically...

Change Row/Column Height & Width
I know I should be able to automatically set a row height to the max necessary by hovering the cursor between the 2 rows I want to adjust and double-clicking, but sometimes this doesn't always work. Why is that that - do I need to adjust a setting? And is there any way to set it so that if text is added or deleted the row height would change automatically so thatthe text fit appropriately? Set the row format to Autofit and cells to Wrap Text Gord Dibben MS Excel MVP On Tue, 19 May 2009 12:14:04 -0700, DaveL <DaveL@discussions.microsoft.com> wrote: >I know I should be ...

Changing Functional Currency #4
Try to change the functional currency to Z-CNY. ERROR = Activity for this currency already exist. Finance made 2 GL transactions. Can we remove the transactions (Tools >> Utilities >> Financial >> Remove History) or (File >> Maintenance >> Clear Data ) then change the functional currency? Which tables should I remove history or clear data. Can someone on the board help us? regards, Once you process a transaction, you are stuck with the functional currency. I have not seen a table fix for this problem on the board. Consider creating a new database an...

Creating a Check Box
I would like to learn how to create a check box. Is there a way to do that? The simplest checkbox (I think) is from the Forms toolbar. So View|tool bars and show that Forms toolbar. Click on the checkbox and then click on the topleft corner where it should be placed. Then draw to the opposite lowerright corner. When you've placed it correctly, right click on it and select "Format Control" On the Control Tab, you can assign a cell link that you can use to determine if the checkbox is checked or not. =if(A1=True,"It's checked","It's not checked") ...

Adding Members- Dist. Lists
Not sure if I should be posting this here or in the SBS group. Does anyone know if there is a way to assign a permission to a user in our office to be able to update membership lists for distribution groups while she is in Outlook? Currently, when she clicks the "To:" button in a new email, right-clicks the distribution group, selects properties, goes to "modify members", it lets her select the new member but then when she clicks ok she will get an error mssg saying she doesn't have permission to do this. thx! on the security tab of the DL, does she have the &qu...

Change default "SaveAs" to *.msg rather than *.html
Hi!, Using Outlook 03, I regularly need to save emails and prefer to save as *.msg so the attachments are contained within the one file. How can you change the default SaveAs command to Save as Type in a *.msg format (rather than *.html) so the type is already *.msg without having to use the pull down? Thank you Troy Outlook provides no way to change that. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "TroyB" <boeky72@hotmail.com>...

Output the list of frequent data
Dear all, Here comes two problems. Problem 1: I have a list of strings (say, in the column A1:A100). How can I find the "mode" (i.e. the string appearing most frequently in the list? For example, if the list is APPLE APPLE BANANA APPLE CREAM CREAM BANANA CREAM APPLE DONUT then I want the result is APPLE. It seems that the MODE function does not suppot data type other than numbers. Is there any canned UDF for it? Problem 2: Following Problem 1, I want to generate a list of the 3 most frequent data in the list. If the list is the one in the example, I want to list to be...

Excel Macro
I am writing a macro and cannot find any command that will allow me to move the cursor in the Worksheet. Rather than give a Cell address such as "A3" I want to be able to move the cursor any given number of cells to the right,left, up or down. Can anyone help? activecell.offset(x,y).select will move x rows down (if positive, up if negative) and y columns to the right (if positive, left if negative). Stephen King wrote: > > I am writing a macro and cannot find any command that will > allow me to move the cursor in the Worksheet. Rather than > give a Cell address ...

change column name from letters to numbers?
I'm importing a 3rd party CSV file into Excel and then comparing some of the contents to a printed spec. Each numbered field in the spec corresponds to a column in the work sheet. I'd like to change the column headers from letters to numbers. Is that possible? Tools-->Options, General tab. Check the R1C1 Reference Style. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Jerry" <jerry@nowhere.com> wrote in message news:OoyPef$eFHA.3048@TK2MSFTNGP12.phx.gbl... > I'm importing a 3rd party CSV file into Excel and then comparing ...

Update table with Multi-select list box
I have a database with a tab control that has several pages in it (my boss loves tabs for navigation). Each page has a list box based on a category of training events that members of my office attend and the box is based on a query that selects the training events for the tab page's respective category. I select an item from the list, click a button, and go to a form with a text box showing the name of the training event I previously selected. On that form, I want to select mutiple names of office members from a list box (already created and source is the Office Roster table) and then c...