Hi all,
I'm not that experienced with Excel VBA, and after googling a little bit, I found some code that supposedly does what I need. It is here: http://stackoverflow.com/questions/3...a-certain-patt
The code goes like this:
Sub CopyRows()
Dim FoundRange As Range
Dim c As Range
For Each c In Application.Intersect(Columns("L"), UsedRange)
If c.Value like "*123*" Then
If FoundRange Is Nothing Then
Set FoundRange = c
Else
Set FoundRange = Application.Union(FoundRange, c)
End If
End If
Next
If Not FoundRange Is Nothing Then
FoundRange.EntireRow.Copy Worksheets("Sheet2").Range("A4")
End If
End Sub
When I run the code, a "Run-time error '424': Object required" error pop-up window appears, and I can't seem to fix it. Firstly, I thought I had to declare the "FoundRange" variable, but after fixing that, the error remains. I believe that it must be a basic error, but I'm not seeing the light. Can anyone help me? I would be deeply appreciated.
I don't know if it matters at all, but I'm using Excel 2007.
Thank you all,
Joćo
Bookmarks