Results 1 to 5 of 5

userform search button remove search only when i type

Threaded View

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Post userform search button remove search only when i type

    hello

    i using a userform to search data and edit them

    i using a combobx1 to search the data and then click the button to find the result

    now i want when i type in combobox or select item from combobox then i show the result. i mean don't want to use the command button


    thanx

    code is here
    Private Sub CommandButton1_Click()
    For Each C In Sheet4.Range("C61:C500").Cells
    If C.Value <> "" Then
    If ComboBox1.Value = C.Value Then
    TextBox1.Value = C.Offset(0, 0).Value
    TextBox2.Value = C.Offset(0, -2).Value
    TextBox3.Value = C.Offset(0, 1).Value
    TextBox4.Value = C.Offset(0, 2).Value
    TextBox5.Value = C.Offset(0, 3).Value
    TextBox6.Value = C.Offset(0, 4).Value
    
    MsgBox "Now you can edit."
    Else
    End If
    Else
    Exit Sub
    End If
    Next
    End Sub
    
    Private Sub CommandButton2_Click()
    For Each C In Sheet4.Range("C61:C500").Cells
    If C.Value <> "" Then
    If ComboBox1.Value = C.Value Then
    C.Offset(0, 0).Value = TextBox1.Value
    C.Offset(0, -2).Value = TextBox2.Value
     C.Offset(0, 1).Value = TextBox3.Value
    C.Offset(0, 2).Value = TextBox4.Value
     C.Offset(0, 3).Value = TextBox5.Value
     C.Offset(0, 4).Value = TextBox6.Value
     TextBox1.Value = ""
     TextBox2.Value = ""
     TextBox3.Value = ""
     TextBox4.Value = ""
     TextBox5.Value = ""
     TextBox6.Value = ""
     ComboBox1.Value = ""
     MsgBox "successful edited."
     Exit Sub
    Else
    End If
    Else
    Exit Sub
    End If
    Next
    End Sub
    and the sample is here
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Save Button and Search On Userform faults
    By flyinghigher2011 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2013, 12:49 PM
  2. [SOLVED] Search button on an USERFORM
    By alopecito in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2012, 09:34 AM
  3. Remove row source from userform listbox1 search results
    By pells in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2012, 09:29 AM
  4. [SOLVED] Search button in userform
    By Ray316 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2011, 09:10 AM
  5. Search Button On Userform
    By markrennolds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2010, 04:06 PM

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