Guest User

Untitled

a guest
Feb 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Option Explicit
  2. Private Sub CommandButton2_Click()
  3.  
  4. Dim r1 As Range
  5.  
  6. Set r1 = Range("Sheet3!A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
  7.  
  8. For Each C1 In r1
  9.  
  10. If C1.Value = ListBox1.Value Then
  11. C1.Font.Bold = True
  12. With C1
  13. C1.EntireRow.Delete
  14. End With
  15. End If
  16.  
  17. Next C1
  18. End Sub
  19.  
  20. Sub UserForm_Initialize()
  21. Range("A2").Select
  22.  
  23. End Sub
  24.  
  25. Private Sub CommandButton1_Click()
  26. If TextBox1.Value = "" Then
  27. MsgBox ("Please Add the component name")
  28.  
  29. Else
  30.  
  31. ActiveCell = TextBox1.Value
  32. ActiveCell.Offset(1, 0).Select
  33.  
  34. ListBox1.RowSource = "Sheet3!A2:A" & Range("A" & Rows.Count).End(xlUp).Row
  35. Call resetForm
  36.  
  37.  
  38. End If
  39. End Sub
  40.  
  41. Sub resetForm()
  42. TextBox1.Value = ""
  43. TextBox1.SetFocus
  44. End Sub
Add Comment
Please, Sign In to add comment