LookUp, Match, Get Adjacent Code, THEN copy/paste 3 things

ChrisOK

Well-known Member
Joined
Mar 26, 2003
Messages
601
Need assistance to accomplish the following b/c the code we have now is pulling too much; need this filtering in place asap:
Code:
Sub IfMatchThenSelectCodeAndPasteAdjacentData()

Sheets("PARTS").Select
'Look for only rows that have no colorization present
'If "J3" of the "PARTS" sheet finds a match in column "P" of the "TECH ORDER" sheet THEN
Code:
If Range("J3").Value = Range("P5:P9") Then '(this needs updated of course)

'look to adjacent cell "H" while on the "TECH ORDER" sheet for a code to use for matching in the 2nd layer of filtering
'FOR EXAMPLE: if there's a code "B" in that adjacent cell "H" then
'locate uncolorized rows that are = "B" (OR) are = "" (blank)

'copy data from that TRUE match from the TECH ORDER sheet to the PARTS sheet
specifically:
'paste a formula into next available empty row of the PARTSto feed in from the "TECH ORDER" sheet
'Specifically:
'what resides in columns G, F, B and A of TECH ORDER sheet should feed into
'.....................columns E, O, P and R of PARTS sheet

' rest of code something like this - where it pastes either the data itself or a formula to auto-pull the data using the formula (don't care
' which method is used -- whichever is easiest

Code:
Sheets("PARTS").Select
Range("E").Select '(next available expty row for pasting formula
ActiveCell.FormulaR1C1 = _
' "=formula goes here that will draw the data in from Column "G" of the other sheet)"

Range("O").Select '(next available expty row for pasting formula
ActiveCell.FormulaR1C1 = _
' "=formula goes here that will draw the data in from Column "F" of the other sheet)"

Range("O").Select '(next available expty row for pasting formula
ActiveCell.FormulaR1C1 = _
' "=formula goes here that will draw the data in from Column "B" of the other sheet)"

Range("R").Select '(next available expty row for pasting formula
ActiveCell.FormulaR1C1 = _
' "=formula goes here that will draw the data in from Column "A" of the other sheet)"

End If

End Sub
 
Last edited:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,215,375
Messages
6,124,580
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top