title: Searching Cell Value in Entire work Book and delete the containg row form each worksheet Excel VBA
body: <p>I have Excel Work book with multiple sheets where two worksheets are master
  list, in which one of the sheets Assetmaster, and second is Masterlist. Now
  the Masterlist has all the records where as the Assetmaster has only portion
  of Masterlist.
  Now I have form with list box displaying the records from Assetmaster. I can
  select record by selecting it. From here I want to delete the selected record
  from both the Excel worksheet, Assetmaster and Masterlist.</p>
  
  <p>Not necessarily both are in same row in respective worksheet.</p>
  
  <hr>
  
  <p>Following code delete the same row number in both worksheets:</p>
  
  <pre><code>Private Sub UserForm_Initialize()
  
    Sheets("assetmaster").Select
    ListBox1.RowSource = "A2:I500"
    Range("A2").Select
    End Sub
  
  Private Sub ListBox1_Click()
    riga = ListBox1.ListIndex + 2
    'Cells(riga, 1).Activate
    testo = ListBox1
    'If testo &lt;&gt; "" Then
    'End If
  
    TextBox1.Text = ActiveSheet.Range("G" &amp; riga)
  
    End Sub
  
  Private Sub CommandButton2_Click()
  
    response = MsgBox("Are you sure you want to delete the Tool " &amp; ActiveCell.Value &amp; "?  Note Tools will be deleted form the masterlist as well if you need please add again in master list using add toolutility " _
        &amp; Chr(10), _
        vbYesNo, Title:="Tool Deletion")
    If response = vbNo Then
    Exit Sub
    Else
    End If
  
    Dim ws As Worksheet
    Dim rs As Worksheet
    Dim Rand As Long
  
    Set ws = Worksheets("assetmaster")
    Set rs = Worksheets("masterlist")
    rs.Unprotect
    ws.Unprotect
    Rand = ListBox1.ListIndex + 2
    'ws.Rows(Rand) = ""
    'rs.Rows(Rand) = ""
    rs.Rows(Rand).Delete
    ws.Rows(Rand).Delete
  
    ' Dim tbmno As String
    ' tbmno = ActiveSheet.Range("G" &amp; Rand)
  
    rs.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveWorkbook.Protect Structure:=True, Windows:=False
    ActiveWorkbook.Save
  
    End Sub
  </code></pre>