Hi guys! Im having some trouble here in setting a code. Let me show you what i've got:
Sub procura()
Dim lin As Integer
Dim teste As String
Dim teste2 As String
lin = 2
teste = Cells(lin, 1)
teste2 = Cells(lin, 2)
While teste2 <> ""
teste = Cells(lin, 1)
teste2 = Cells(lin, 2)
If teste = "ABERTURA" Then Cells(lin, 3) = teste2
lin = lin + 1
Wend
End Sub
See, ive got a file with 2 columns, one with strings, another with doubles. setting the criteria, i need it to copy ALL the double's cells that got "ABERTURA" as string, and paste it on another file. This code ive got will do that for the same file, but i need it to search with this criteria on one file, and paste all the matched cells on a column in another file! ANY HELP WOULD BE GLADLY APPRECIATED!!!
Sub procura()
Dim lin As Integer
Dim teste As String
Dim teste2 As String
lin = 2
teste = Cells(lin, 1)
teste2 = Cells(lin, 2)
While teste2 <> ""
teste = Cells(lin, 1)
teste2 = Cells(lin, 2)
If teste = "ABERTURA" Then Cells(lin, 3) = teste2
lin = lin + 1
Wend
End Sub
See, ive got a file with 2 columns, one with strings, another with doubles. setting the criteria, i need it to copy ALL the double's cells that got "ABERTURA" as string, and paste it on another file. This code ive got will do that for the same file, but i need it to search with this criteria on one file, and paste all the matched cells on a column in another file! ANY HELP WOULD BE GLADLY APPRECIATED!!!