Hey there,
another question for you guys:
This macro, I got from mike in this forum (thx again) works great but I need to modify it and don't know how exactly. I underlined the code I need to be different. I want the macro to search exactly how it does but to move on without printing any result if the content of the cell it finds with CellPtr is not a number like this:11-3401-9970-1-92.
So I want it to yump over text or empty rows without doing anything but continuing with the next number.
With ws2 ' Loop thru Rows in Column A on ws2=(Worksheets("Sheet2")) to last row
For CellPtr = 2 To .Cells(Rows.CountLarge, "a").End(xlUp).Row ' Try finding the cell with part number in RawDataCentauri
'If Not CellPtr Is Nothing Then 'If CellPtr Is ("""" - """""""" - """""""" - "" - """") Then Set FoundCell = ws1.Range("A:A").Find(What:=.Cells(CellPtr, 1), LookAt:=xlWhole) ' If part number is found then FoundCell will Something(A Range) and not Nothing
'Else
'Next
If Not FoundCell Is Nothing Then ' FoundCell Address will be in Column A so we use offset 0 rows, and 1 column to the right
' to get the value in column B
.Cells(CellPtr, "c") = FoundCell.Offset(0, 1)
Else ' didnt find the part
.Cells(CellPtr, "c") = 0
End If
Next
End With
Can anyone help me out here???
Bookmarks