I would attach the .xls's here but they are both 5.4MB's big (avg of 2.5 million cells). They are the schedules of where my father has worked for the last 3 years at a company. They have included everyone on the schedule (not just him). I need to find his name on each sheet between both workbooks (I'll run the macro two times if I need to. Once for each workbook), copy the whole row, then paste it into a NEW workbook. (Each workbook has 69 slides). Now, I have tried using some VGA scripts I came across but nothing seems to do the trick... Maybe I am just retarded in this area. I'm seriously biting the bullet at this point and nervous that I will not complete on time.
Some specifics: The column I will be searching in will be the F or G column; The name will be typed out as; Mr. Bobby , Mr Bobby, or MR BOBBY. Umm anything more just ask. I'm probably not be able to sleep tonight unless I complete this anyways, so I'll be here periodically.
-Timothy X
I found ONE script that seems to be in the area of what I am looking for ... but I edited the values and it seems to not work. (After it is finished it says 0 rows copied!) I am green behind the ears but not incompetent. God, I hope one of you guys can help me soon.
Sub customcopy()
Application.ScreenUpdating = False
Dim lastLine As Long
Dim findWhat As String
Dim toCopy As Boolean
Dim cell As Range
Dim i As Long
Dim j As Long
findWhat = CStr(InputBox("Enter the word to search for"))
lastLine = ActiveSheet.UsedRange.Rows.Count
j = 1
For i = 1 To lastLine
For Each cell In Range("G1:H2000").Offset(i - 1, 0)
If InStr(cell.Text, findWhat) <> 0 Then
toCopy = True
End If
Next
If toCopy = True Then
Rows(i).Copy Destination:=Sheets(2).Rows(j)
j = j + 1
End If
toCopy = False
Next
i = MsgBox(((j - 1) & " row(s) were copied!"), vbOKOnly, "Result")
Application.ScreenUpdating = True
End Sub
Bookmarks