Hello! Using VBA for first time, so everything is toughed for me.. The problem is: we need to find on the first sheet named SD in second column all cells contianing word 'drilling', then for each cell copy row which contains that cell and paste it in other sheet or book (doesn't matter). Please help me, the work is urgent and my code doesn't work
Dim lCount As Long
Dim rFoundCell As Range
Sheet("SD").Activate
Set rFoundCell = Range("B2")
For lCount = 1 To WorksheetFunction.CountIf(Columns(2), "drilling")
Set rFoundCell = Columns(2).Find(What:="drilling", After:=rFoundCell, _
LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False)
With rFoundCell
.Select.Row
.Selection.Copy
Windows("Book1").Activate
Columns("'lcount'").Select
ActiveSheet.Paste
Windows("SD").Activate
End With
Next lCount
End Sub
Software/Hardware used:
ASKED:
July 16, 2008 6:50 AM
UPDATED:
August 30, 2008 2:17 AM