Hell Every body
I want to compare the two strings in one worksheet and when the string is matched then open the new workbook automatically and the column next to the matched string is written to the new open workbook cell B1. The code is written below it just match the string, when the string is matched then it open the new workbook, but the next step in which i am fail is that i cannot copy the data from one workbook to other, and the sample workbook is also attached with this email.
Sub Test()
Dim i As Integer
Dim string
i = 5
string = "C:\Documents and setting\Desktop\Macro\Test1.xls"
Do Until IsEmpty(ThisWorkbook.Sheets(1).Cells(i, 2))
If (ThisWorkbook.Sheets(1).Cells(i, 2) Like ThisWorkbook.Worksheets(1).Cells(1, 2)) Then Workbooks.Open (string)
i = i + 1
Loop
End Sub
Bookmarks