title: Creating a vba code to show a message not to appear duplicates in some sheets
body: <p>Currently i have this code to register daily all meals at a canteen.</p>
  <pre><code>  Sub register()
    Dim s As Worksheet
    Set s = Worksheets(&quot;Lista_&quot; &amp; Range(&quot;K9&quot;).Value)
    Dim row As Long
    row = s.Cells(s.Rows.Count, &quot;B&quot;).End(xlUp).row + 1
    s.Cells(row, &quot;B&quot;).Value = Range(&quot;C7&quot;).Value
    s.Cells(row, &quot;C&quot;).Value = Range(&quot;C9&quot;).Value
    s.Cells(row, &quot;H&quot;).Value = Range(&quot;L9&quot;).Value
    s.Cells(row, &quot;I&quot;).Value = Range(&quot;P20&quot;).Value
    s.Cells(row, &quot;N&quot;).Value = Range(&quot;P21&quot;).Value
    s.Cells(row, &quot;O&quot;).Value = Range(&quot;P1&quot;).Value
    Range(&quot;M6:M19&quot;).Select
   Range(&quot;M19&quot;).Activate
  Selection.ClearContents
  Range(&quot;C7:D7&quot;).Select
  Selection.ClearContents
  Range(&quot;C7&quot;).Select
  End Sub
  </code></pre>
  <p>--</p>
  <p>I would like there to be a message if an employee's number has already been registered (so as not to duplicate it)... for that the vba code should search on all pages if that number already existed or not.If the number appears in column B of sheets that begin with &quot;Lista_&quot; a message should appear</p>