Results 1 to 3 of 3

how can ListIndex can be pass when botton click

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-12-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    134

    how can ListIndex can be pass when botton click

    hi
    i find this user form in this forum and i change to my need but it "Modify & Return"
    button not work. As it suppose to change the same raw of sheet as in
    list box 1 raw .insted of it change 2nd raw every time if u change the value in any textBox
    but ineed to change the same raw which is selected in listbox.

    Private Sub CommandButton2_Click()
    'Modify list and return to Page1
        var1 = 1
        Sheet1.Range("A2").Offset(ListBox1.ListIndex, 0).Value = ComboBox1
        Sheet1.Range("B2").Offset(ListBox1.ListIndex, 0).Value = TextBox1
        Sheet1.Range("C2").Offset(ListBox1.ListIndex, 0).Value = TextBox2
        Sheet1.Range("D2").Offset(ListBox1.ListIndex, 0).Value = Val(TextBox3)
        Sheet1.Range("E2").Offset(ListBox1.ListIndex, 0).Value = Val(TextBox4)
        Sheet1.Range("F2").Offset(ListBox1.ListIndex, 0).Value = ComboBox2
        TextBox7 = Round((TextBox4.Value / TextBox3.Value), 2)
        TextBox6 = Round(TextBox7, 2)
        Sheet1.Range("G2").Offset(ListBox1.ListIndex, 0).Value = TextBox5
        Sheet1.Range("H2").Offset(ListBox1.ListIndex, 0).Value = Val(TextBox6)
        
        'Sheet1.Range("H2").Offset(ListBox1.ListIndex, 0).Value = Val(TextBox7)
        Sheet1.Range("I2").Offset(ListBox1.ListIndex, 0).FormulaR1C1 = "=RC[-4]/RC[-5]"
        var1 = Empty
        ListBox1.TopIndex = ListBox1.ListIndex    'returns to same place on ListBox1
        ListBox1.ListIndex = -1    'turns off selection on ListBox1
        MultiPage1.Pages(0).Enabled = True
        UF_List.MultiPage1.Value = 0
        MultiPage1.Pages(1).Enabled = False
    End Sub
    any help is appreciated.
    Attached Files Attached Files

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