title: get data from previous sheets
body: <p>Can you guys help me out? I think i'm kind of stuck with the code below. I almost got the code that I wanted but at the end it does not do the thing I like.</p>
  
  <pre><code>Dim acs, cos, as_col, as_row As Integer
  
       cos = Sheets.Count
       acs = ActiveSheet.Index
  
       as_LRow = Sheets(acs).Cells(Sheets(acs).Rows.Count, "A").End(xlUp).Row
  
       For as_row = 3 To as_LRow
          std_number = Sheets(acs).Cells(as_row, 1).Value 
  
          earliersheets = acs - 1 
  
          For s = 1 To earliersheets
               ilast_row = Sheets(s).Cells(Sheets(s).Rows.Count, "A").End(xlUp).Row 
               For r = 3 To ilast_row
                  std_number_new = Sheets(s).Cells(r, 1).Value
  
                  If std_number = std_number_new Then
                      a = a &amp; Sheets(s).Cells(r, 6).Value
                      'Sheets(acs).Cells(as_row, 8).Value = Sheets(s).Cells(r, 8).Value
                      Sheets(acs).Cells(as_row, 8).Value = Sheets(acs).Cells(as_row, 6).Value &amp; " + " &amp; a
  
                  End If
                  a = ""
               Next r
  
          Next s
  
       Next as_row
  </code></pre>
  
  <p>What I want is:
  After adding, manually, a new sheet I want to press on a button. This button activates the code above. What I want is to check a value in a particulaire cell in column "A". If the value in this column matches with the value from previous sheet then display the value in the sixth column in the newly added sheet. The code above does that, but it works only for two sheets. If I make more then two sheets it does not display more values then two.</p>
  
  <p><strong>Update</strong>
  I added my file in the link: <a href="http://ge.tt/6EKKUmf2" rel="nofollow">Check.xlsm</a><br>
  After opening this file clear the H-column in the third (and maybe the second sheet) then run the macro within. You'll see what I mean
  <a href="https://i.stack.imgur.com/dHQmR.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/dHQmR.jpg" alt="enter image description here"></a></p>
  
  <p>All I want is to get all the previous values in previous sheet displaced in column-H. For example I marked two cells with values, these values get displayed in the H-column after running the macro.</p>