Alright, here we go, I need an append code with a condition that must be met. This is what I have so far:
Dim cRow As Long
Dim DestSheet As Worksheet
Dim SourceSheet As Worksheet
cRow = Sheets("Import").Range("A1").End(xlDown).Row
Set DestSheet = Sheets("Conversion")
Set SourceSheet = Sheets("Import")
For x = 1 To cRow
If SourceSheet.Range("B" & x) = "#N/A" Then
SourceSheet.Range(Cells(x, "A"), Cells(x, "A")).Copy
DestSheet.Range("C65536").End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
End If
Next x
The catch is there are going to be multiple "#N/A" with the same value in column A. What I need is something that looks at Conversion sheet to see if any of the "#N/A" exist already. Or code that only pulls data from the first "#N/A" for that particular data.
Example:
Column A Column B
1 data
2 #N/A
3 left
1 good
2 #N/A
3 what
1 now
2 #N/A
3 Who
This code is going to pull all the "2" in column A. I only what it to pull one in. The reason for this is it then appends into a conversion table and I dont want any duplicates for integrity purposes. Any ideas would be great. thanks
Dim cRow As Long
Dim DestSheet As Worksheet
Dim SourceSheet As Worksheet
cRow = Sheets("Import").Range("A1").End(xlDown).Row
Set DestSheet = Sheets("Conversion")
Set SourceSheet = Sheets("Import")
For x = 1 To cRow
If SourceSheet.Range("B" & x) = "#N/A" Then
SourceSheet.Range(Cells(x, "A"), Cells(x, "A")).Copy
DestSheet.Range("C65536").End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
End If
Next x
The catch is there are going to be multiple "#N/A" with the same value in column A. What I need is something that looks at Conversion sheet to see if any of the "#N/A" exist already. Or code that only pulls data from the first "#N/A" for that particular data.
Example:
Column A Column B
1 data
2 #N/A
3 left
1 good
2 #N/A
3 what
1 now
2 #N/A
3 Who
This code is going to pull all the "2" in column A. I only what it to pull one in. The reason for this is it then appends into a conversion table and I dont want any duplicates for integrity purposes. Any ideas would be great. thanks