Hi Everyone,
I'm asking for some assistance again.
I have the code below that in part works but needs a little of your expertise in tweaking.
1. It runs to slow and the screen flashes, I have screen updating turned off but cant get it to run smoother?
2. It searched the entire document in column '"L", can I set a range of L3:L100, because the sheet doesn't have that much data?
Thanks again, Brad.
[Code]Sub SearchForString()
Dim LSearchRow As Integer
Dim LCopyToRow As Integer
On Error GoTo Err_Execute
ScreenUpdating = False
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Select
Range("B3:K100").Select
Selection.Delete
Sheets("Sheet1").Select
LSearchRow = 3
LCopyToRow = 3
While Len(Range("l" & CStr(LSearchRow)).Value) < 7
If Range("l" & CStr(LSearchRow)).Value < 7 Then
i = 1
Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Range(Cells(i, 1), Cells(i, 11)).Select
Selection.Copy
Sheets("Sheet2").Select
Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
ActiveSheet.Paste
LCopyToRow = LCopyToRow + 1
Sheets("Sheet1").Select
End If
LSearchRow = LSearchRow + 1
Wend
Application.CutCopyMode = False
Sheets("Sheet2").Select
Range("A3").Select
MsgBox "All matching data has been copied."
ScreenUpdating = True
Exit Sub
Err_Execute:
MsgBox "An error occurred."
End Sub[Code]
Bookmarks