title: search and update into a single cell
body: <p>I am new to VBA excel, a week old. I have little knowledge in C , with that I have created a program.</p>
  
  <p>The task is that "to search a particluar Number in one excel worksheet(1) and compare in another worksheet(2), get the corrosponding coloumn data , concatinate the information into once cell on Worksheet(1) .</p>
  
  <p>I tried but I can't get the process done I need a valuable suggestion how to fix my code.</p>
  
  <p>My code:</p>
  
  <pre><code>Sub test1()
  Dim iComp
  Worksheets("BSM_STF_iO").Select
  LastRow = Range("A" &amp; Rows.Count).End(xlUp).Row
  For i = 2 To LastRow
  
        a = onlyDigits(Range("A" &amp; i).Value)
         If InStr(a, "T") Then
         Else
  
       Worksheets("Tabelle1").Select
          destlastrow = Range("B" &amp; Rows.Count).End(xlUp).Row
          For j = 2 To destlastrow
           b = onlyDigits(Range("B" &amp; j).Value)
            iComp = StrComp(a, b, vbBinaryCompare)
          Select Case iComp
         Case 0
  Sheets("Tabelle1").Range(Sheets("Tabelle1").Cells(j, 3), Sheets("Tabelle1").Cells(j, 4)).Copy
  Sheets("Tabelle1").Activate
  erow = Sheets("Tabelle1").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
  ActiveSheet.Paste Destination:=Sheets("Tabelle1").Range(Cells(erow, 8), Cells(erow, 9))
  Sheets("BSM_STF_iO").Activate
  End Select
          Next j
  
  
      End If
  
  Next i
  End Sub
  Function onlyDigits(s As String) As String
      Dim retval As String
      Dim i As Integer
      retval = ""
                retval = s
        onlyDigits = retval
  End Function
  </code></pre>
  
  <p>Example:</p>
  
  <p>I need to put all the information from "tabelle1" worksheet information of "10000" to "BSM_STF_io" 10000.</p>
  
  <p><a href="http://i.stack.imgur.com/IO5wZ.jpg" rel="nofollow">BSM_STF_io</a><br>
  <a href="http://i.stack.imgur.com/Dw30y.jpg" rel="nofollow">Tabellle1</a></p>