lekrystalw
New Member
- Joined
- Nov 12, 2018
- Messages
- 1
I'm trying to turn this IF EQUALS STATEMENT TO an IF CONTAINS STATEMENT...I know i need to use INSTR but i can't figure out the full logistics..see code below...i need to change the part that says If Cells(i, 2) = idmtitle Then
Sub finddata()
Dim idmtitle As String
Dim finalrow As Integer
Dim i As Integer
Sheets("ComboSheet").Range("k7:n100").ClearContents
idmtitle = Sheets("ComboSheet").Range("k2").Value
finalrow = Sheets("ComboSheet").Range("b10000").End(xlUp).Row
For i = 2 To finalrow
If Cells(i, 2) = idmtitle Then
Range(Cells(i, 1), Cells(i, 4)).Copy
Range("k100").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats
End If
Next i
Sub finddata()
Dim idmtitle As String
Dim finalrow As Integer
Dim i As Integer
Sheets("ComboSheet").Range("k7:n100").ClearContents
idmtitle = Sheets("ComboSheet").Range("k2").Value
finalrow = Sheets("ComboSheet").Range("b10000").End(xlUp).Row
For i = 2 To finalrow
If Cells(i, 2) = idmtitle Then
Range(Cells(i, 1), Cells(i, 4)).Copy
Range("k100").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats
End If
Next i