fari1
Active Member
- Joined
- May 29, 2011
- Messages
- 362
hi,
i'm trying to make it work a code, that may find a text string starting with Consolidated out of the whole sheet and with match case True i-e Consolidated
i've a code that finds a text string starting with certain text, but it is not working on my data, as i need to find every cell in the sheet and match case also.any help over it would be greatly appreciated
i'm trying to make it work a code, that may find a text string starting with Consolidated out of the whole sheet and with match case True i-e Consolidated
i've a code that finds a text string starting with certain text, but it is not working on my data, as i need to find every cell in the sheet and match case also.any help over it would be greatly appreciated
Code:
Public Sub FindData()
Dim lLastRow As Long
With Sheets("Sheet2")
lLastRow = .Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lLastRow
If InStr(1, .Range("A" & i).Value, "Consolidated") = 1 Then
.Rows(i).Copy Destination:=Sheets("sheet3").Range("A" & Rows.Count).End(xlUp)(2)
End If
Next i
Application.CutCopyMode = False
End With
End Sub