+ Reply to Thread
Results 1 to 5 of 5

Obtaining an offset value from a userform combobox

Hybrid View

  1. #1
    Registered User
    Join Date
    10-07-2005
    Posts
    48

    Obtaining an offset value from a userform combobox

    Hi all,

    I currently have a userform setup so that when the user puts a value into a textbox and press a button it prints the values on the screen.

    I have now added a combobox into the form and want the user to select a value from worksheet 2 (named test1 and test2).
    What I want it too do is print out the values to the right of the selected combobox item(test1 or test2).

    I cannot find the syntax to allow me to do this.

    The excel sheet I am working on is attached, any help will be appreciated.

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I can't understand what you are doing. You form looks like it is designed to enter data to the parts sheet. What is the purpose of the combobox?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-07-2005
    Posts
    48
    The combo box is meant to look at the column A in sheet2. When the user selects either test1 or test2 and click on the 'Add this part' button I need it to print out column B,C,D and E in sheet 2 with the row depending on the value in the combo box. These values need to be printed into sheet1 column E,F,G and H along with the other information that is printed.

    Hope this helps.

    cheers

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You will need to check this, I don't know which TextBoxes refer to which Column on Sheet 2.

    Private Sub ComboBox1_Change()
        Dim R      As Long
        With Me
            R = .ComboBox1.ListIndex + 1
            .TxtPart = Sheet2.Cells(R, 2).Value
            .TxtLoc = Sheet2.Cells(R, 3).Value
            .TxtDate = Sheet2.Cells(R, 4).Value
            .TxtQty = Sheet2.Cells(R, 5).Value
        End With
    End Sub
    Last edited by royUK; 02-20-2008 at 09:30 AM.

  5. #5
    Registered User
    Join Date
    10-07-2005
    Posts
    48
    Thanks alot for the help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1