Posts by norwood

    Hi


    I have a userform which has a number of multipage controls nested inside each. So, the parent is Multipage1 with 2 pages. Page 1 of Multipage1 has a second multipage control (Multipage2 which has 4 pages). In Multipage2, page1 there is a 3rd Multipage control (Multipage3 which has 2 pages). In Multipage2, page 2 there is another multipage control (Multipage4 which has 3 pages)...and so on! I know this sounds complicated, but I am trying to get the caption of the selected multipage.


    There are commandbuttons in all of the pages, which when clicked need to return the caption name of the multipage where they sit.


    I have started the following code, but suspect there must be a better solution:


    Code
    With Sales
        If .MultiPage1.Value = 0 Then
        Hardware_Purchases_Input.TextBox6.Value = .MultiPage1.SelectedItem.Caption & " - " & .MultiPage2.SelectedItem.Caption & " - " & .MultiPage3.SelectedItem.Caption
        End If
        End With

    Re: Transfer data from textbox to a listbox using VBA


    Hi cytop


    Yep! This works! Thanks for that. However, the second item is showing on the next line in the ListBox2. How can I amend your code to show the second item (txtDepartmentCost) in column 2 of ListBox2 (Column 1 of ListBox2 has the data from ListBox1, i.e. DepartmentName). Hope that makes sense! Cheers

    Hi


    I can't seem to get my head round this.


    I have populated a listbox (ListBox1) with Department Names. When I select a department from this listbox, the name of the chosen department is shown in a textbox (txtDepartmentName). I also have a second listbox (ListBox2) which I want to show selected department names and another bit of data from another textbox (txtDepartmentCost). I have used the following code, which is working with one loop, but crashes on the second time! I don't know how to resolve this. Can anyone help? :thanx:


    Code
    ListBox2.Value = txtCostCentre.Value

    Hi


    I have a listbox on a userform which shows the first column of a named range.


    I want users to select multiple items from the list box and on selection, the associated other column is transferred to the last row, column 21 in a spreadsheet.


    The column information is as follows:


    Column 1 Column 2
    Name 1 25
    Name 2 84
    Name 3 12
    Name 4 62
    Name 5 3


    The user will see only data in column 1 on the multi column listbox. If the user selects Name 1, Name 3 and Name 5, the corresponding data in column 2 will be populated in the cell(lRow, 21) of the spreadsheet, ie


    25
    12
    3


    I have used the following code, but it does not give me the desired result. In the Listbox property, I have set boundcolumn as 1 and ColumnCount as 2



    Can anybody advise why it's not working?


    Many thanks

    Hi


    I have been scouring the web for info on this without success![Blocked Image: http://www.excelforum.com/images/smilies/frown.gif]


    I have a userform where users can input names of suppliers. As this list is built up, I want to have option buttons that have a caption name based on the most popular supplier name so that they can simply chose a supplier by clicking the appropriately named supplier. So, if after 10 entries, supplier "Smith" has been inserted 6 times and supplier "Jones" inputted 2 times and two other suppliers have been inputted once, I would like to have OptionButton1.Caption="Smith" and OptionButton2.Caption="Jones" created on the userform.


    This requires code for counting duplicates and ranking the result. I can't seem to get started on this!! Can anybody provide any guidance/help?


    Cheers[Blocked Image: http://www.excelforum.com/images/smilies/smile.gif]http://www.excelforum.com/exce…create-a-ranked-sort.html