السلام عليكم و رحمة الله
اليكم ملف مرفق به صفحتان الصفحة روتيتد بجيب البينات من صفحة التوبكس عن طريق زر GET DATA و اريد ان احضر داتا LOAD PORT من ورقة اكسيل اخرى من عمود معين و يعمل بحث و يجيب الداتا بس انا حاولت بس فشلت اليكم الكود الداخلى
Sub GET_DATA()
Dim FindString As Range
Dim rng As Range
For Each FindString In Range("A:A")
If Trim(FindString) <> "" Then
With Sheets("TOPX").Range("A:A")
Set rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
FindString.Offset(0, 1) = rng.Offset(0, 1)
FindString.Offset(0, 2) = rng.Offset(0, 2)
FindString.Offset(0, 3) = rng.Offset(0, 3)
FindString.Offset(0, 4) = rng.Offset(0, 4)
FindString.Offset(0, 5) = rng.Offset(0, 5)
FindString.Offset(0, 6) = rng.Offset(0, 6)
End If
End With
End If
Next
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please select a file")
If NewFN = False Then
' They pressed Cancel
MsgBox "Stopping because you did not select a file"
Exit Sub
Else
Workbooks.Open Filename:=NewFN
Workbooks("ROTATED.xlsm").Activate
Sheets("Rotated container").Select
For Each FindString In Range("A:A")
If Trim(FindString) <> "" Then
Workbooks(NewFN).Activate
Sheet1.Select
With Sheet1.Range("A:A")
Set rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
FindString.Offset(0, 8) = rng.Offset(0, 8)
End If
End With
End If
Next
End If
End Sub
New folder.rar