I have a word document (word 2003) with tables using data from Excel Workbook (Excel 2003) I want to fill the tables. There are 20 tables in each row with 15 tables.
I want to add and activate every line, where the user can choose from 1 to 5 marks. This event will replace a label. The same line, called the condition, makes "very good" for "very poor". Then will display 3 options from next combobox excel sheet. I have 1 line ready :) and I want to generalize it.
I read about classes, but I'm not sure if I can use it for the active X combo box. And I read something about the Oleobjects and about each option.
I am learning VBA on my own, this is not my business, sorry for my mistakes Thanks a lot, Mariana
Private sub-combo box 2_DropButtonClick The string string was chosen as Excel in the form of slow XLF. App dim as WB Excel Excel as workbook dim xs Combo box 2 as a slow start in form of worksheet slow line. List index & gt; -1 then strselected = ComboBox2.List (ComboBox2.ListIndex) closing if combo box 2. List tab & gt; 0 then i Combo box 2. Clear and with Me Combo box 2. Add etem "1" .AddItem "2" .AddItem "3" .AddItem "4" .AddItem "5" .AddItem "6" .AddItem "NS" .AddItem "NS" .ListIndex = ComboBox2 with Sambos2. Value = strseelected case combo box 2.list index number 0 label 2. Caption = "Very Good" Case 1 Label 2 Caption = "good" case2 label 2 Caption = "Sequestration" case 3 label 2 Caption = "Enough" Case 4 Label 2 Caption = "weak" case 5 label 2. Caption = "very poor" case 6 label 2. Caption = "not seen" and set select xlap = new excel Set the application wb = xlApp.Workbooks.Open (FileName: = "C: \ user \ ... \ test.xlsx") Set ws = wb.Worksheets (1) me.ComboBox3. Select clear comment = 5 case label 2. Caption case "very good" start = 4 line = 1 to 3 May Combo box 3 Adtume Y. Seals (line + start, comment) Next line me.ComboBox3 List index = 0 case "good" start = 7 line = 1 to 3. Combo box 3 Aditam Y. Seals (line + start, comment) next line me.ComboBox3.ListIndex = 0 for the case "SaticFactory" start = 10 = 1 to 3 me.ComboBox3.AddItem ws.Cells (line + start, comment) Next Line Me. ComboBox3.ListIndex = 0 case "enough" to start = line = 1 to 3m Combo box 3 Aditam Y. Seals (line + start, comment) next line me.ComboBox3.ListIndex = 0 case "Poor" start = 16 line = 1 for 3 Me.ComboBox3.AddItem ws.Cells (line + start, comment) Next line me.ComboBox3 .ListIndex = 0 case "very poor" start = 1 for line = 1 to 3 me. Combobox 3. Aditum ws.Cells (line + start, comment) Next line Me.ComboBox3.ListIndex = 0 "Started not seen" case = 22 for line = 1 to 3 me. Combobox 3.Adit ws.Cells (line + start) , Comment) Select the next line me.ComboBox3.ListIndex = 0 end choose wb.Close xlApp.Quit xlApp = None Ending sub private sub-combo box 3_Change () 'I had to add a textbox too, so with the text in the combobox Does not display a longer text. Textbox 1 Width = 235.8 .MultiLine = True .WordWrap = True .Text = ComboBox3.Value. AutoSize = True End with AutoSize = End End
No comments:
Post a Comment