After looking around, I distilled this code down https://www.techonthenet.com/excel/macros/search_for_string.php that partially achieves what I need. Most of the examples I've found usually copy entire rows along with the example I've submitted. I only need 2 offset values (columns C:D) copied and pasted into my table. Could someone tell me what the correct syntax is to replace the Rows code with the adjacent cells associated with the found value? Many thanks for your time and consultation. Thanks to these forums, I am learning so much about Excel and VBA (and my limits ).
Code:
Sub SearchMove()
Dim fValue As Integer
Dim mValues As Integer
On Error GoTo Err_Execute
fValue = 1
mValues = 2
While Len(Range("A" & CStr(fValue)).Value) > 0
If InStr(1, Range("E" & CStr(fValue)).Value, "chupacabras") > 0 Then
Rows(CStr(fValue) & ":" & CStr(fValue)).Copy [COLOR=#ff0000]'need to copy associated value in C:D...not entire row...as a side note, what is the purpose of the & ":" &??[/COLOR]
Sheets("blah").Rows(CStr(mValues) & ":" & CStr(mValues)).PasteSpecial [COLOR=#ff0000]'tried just Paste but gives an error...not sure why PasteSpecial works...maybe bc of entire row?[/COLOR]
LCopyToRow = LCopyToRow + 1
Sheets("temp").Select [COLOR=#ff0000]'temp sheet will delete after routine[/COLOR]
End If
fValue = fValue + 1
Wend
Application.CutCopyMode = False
Range("A1").Select
Exit Sub
Err_Execute:
MsgBox "Derp."
End Sub