I have no idea what I am doing and if you feel like yelling at me that's cool.
I am wondering how I would go about checking values of each cell in column D on a worksheet called PriceList against values in a text file ItemNumber.txt.
If the content of the cells in the column is equal to one of the values in said text file I want it to copy the row and paste it into sheet1....
Option Explicit
Sub CompareValue()
Dim FileNum As Integer
Dim DataLine As String
Dim cel As Range
Dim celString As String
' Select file to be opened
FileNum = FreeFile()
Open "C:\Users\jreinhold\Documents\ItemNumbers.txt" For Input As #FileNum
Set myRange = Range("D:D")
For i = 1 To myRange.Rows.Count 'loop through rows by using i as a cell reference
Do While Not EOF(FileNum) 'run input from file while not end of file
Line Input #FileNum, DataLine 'input line data into DataLine
' Check value of cell against read in data
If InStr(DataLine, myRange.Cells("D", i).Value) = 0 Then 'compare DataLine to cell i
' Copy Row Where match resides
DataLine = DataLine + 1 'if value of comparison is 0 add 1 to data line and get next line in text file
Loop 'Loop back around and plus next line for the data from the file in and check values against cell i again
End If 'end If once value for comparison is true
Source.Rows(c.Row).Copy Target.Rows(i) ' Copy row
Sheets("Sheet1").Paste ' Paste row into Sheet1
i = i + 1 ' add 1 to i in order to continue to next cell in column
Next i 'check next cell for the data inputs using the same code.
Wend
End Sub