done quite a bit of research and I cannot quite figure this out.. This is one workbook, searching between Sheet "Quote" and sheet "Export"
This script should be
- searching for "PartNum" starting in Quote sheet once found
- moves down 2 cells
- Copies the value on the new active cell
- searches for that value in worksheet "export"
- once found copies the value offset 24 cells to the right
- returns to worksheet "quote"
- Finds "Leadtime"
- move down 2 cells and pastes the value
The part i'm stuck on, I didn't write this correctly to loop as i would like, how can i accurately loop 1 row lower each time for BOTH Partnum and Leadtime? Is there any way I can add so it ignores if a part is not found instead of erroring out?
'Find PartNum
Worksheets("Quote").Activate
Cells.Find(What:="PartNum").Offset(2, 0).Select
'Copy/search part Num
Dim str1 As String
Dim Cntr As Integer
Cntr = 0
Do While Cntr <= 650
Cntr = Cntr + 1
str1 = ActiveCell.Value
Selection.Copy
Worksheets("Export").Activate
ActiveCell.Select
Cells.Find(What:=str1, After:=ActiveCell, LookIn:= _
xlFormulas, lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
ActiveCell.Offset(0, 24).Range("A1").Select
Selection.Copy
Worksheets("Quote").Activate
'Find PartNum
Cells.Find(What:="Leadtime").Offset(2, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues