Loopup Values greater than a set value and place data on another sheet

ctigers

New Member
Joined
Nov 6, 2013
Messages
44
Hello, have 2 sheets. On sheet B I have values listed in column K. On sheet A I need to enter a formula to lookup the values in column K on Sheet B and if there are any values in K greater than 100, list that data on sheet A. Tried a VLOOKUP but could get it to work.
SHEET A
ABCDEFGHIJK
SC6/2/2014 13:456/2/2014 21:086/3/2014 17:286/4/2014 17:21JTRELA6/5/2014 9:26MSCSSC26/5/2014 19:30DCOWAN1250
SC6/2/2014 11:206/2/2014 12:426/2/2014 15:106/2/2014 15:55MHARRIS6/2/2014 17:43BHUMPHRE6/3/2014 15:40TEJONES252
SC6/2/2014 10:376/2/2014 11:396/3/2014 18:306/3/2014 19:04PORTIZ6/4/2014 14:09CHART6/4/2014 16:19AGUILLEB1100
SC6/2/2014 13:456/2/2014 19:576/3/2014 12:456/3/2014 13:03JTRELA6/3/2014 16:52SDAWSON6/4/2014 20:09DCOWAN110
SHEET B
ABCDEFGHIJK
SC6/2/2014 12:296/2/2014 17:286/2/2014 18:026/3/2014 14:19JTRELA6/3/2014 15:53SDAWSON6/5/2014 9:00AGUILLEB98
SC6/2/2014 11:206/2/2014 20:106/3/2014 8:466/3/2014 15:25JTRELA6/4/2014 15:58SDAWSON6/5/2014 15:15AGUILLEB70
SC6/2/2014 11:206/2/2014 13:026/2/2014 18:486/3/2014 9:20JTRELA6/3/2014 9:29JTRELA6/3/2014 12:35DPEPPERS55
SC6/2/2014 13:456/2/2014 21:086/3/2014 17:286/4/2014 17:21JTRELA6/5/2014 9:26MSCSSC26/5/2014 19:30DCOWAN1250
SC6/2/2014 11:206/2/2014 12:426/2/2014 15:106/2/2014 15:55MHARRIS6/2/2014 17:43BHUMPHRE6/3/2014 15:40TEJONES252
SC6/2/2014 13:456/2/2014 19:576/3/2014 12:066/3/2014 14:07JTRELA6/3/2014 15:55SDAWSON6/5/2014 9:09CMACOMSO75
SC6/2/2014 10:376/2/2014 11:396/3/2014 18:306/3/2014 19:04PORTIZ6/4/2014 14:09CHART6/4/2014 16:19AGUILLEB1100
SC6/2/2014 11:206/2/2014 13:026/3/2014 14:536/3/2014 16:03ACLINKSC6/3/2014 16:09BHUMPHRE6/5/2014 10:58LHAMMOND11
SC6/2/2014 13:456/2/2014 19:576/3/2014 12:456/3/2014 13:03JTRELA6/3/2014 16:52SDAWSON6/4/2014 20:09DCOWAN110

<tbody>
</tbody><colgroup><col><col span="4"><col><col><col><col><col><col></colgroup>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
No, VLOOKUP can only be used to get data in the range right of (and including) the column beeing looked up.

I am assuming you want to use a macro to move down column K and then transfer the row to Sheet A

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> CopyOver100()<br>    <SPAN style="color:#00007F">Dim</SPAN> rF <SPAN style="color:#00007F">As</SPAN> Range, r1st <SPAN style="color:#00007F">As</SPAN> Range, rOut <SPAN style="color:#00007F">As</SPAN> Range<br>    <SPAN style="color:#00007F">Dim</SPAN> wsA <SPAN style="color:#00007F">As</SPAN> Worksheet, wsB <SPAN style="color:#00007F">As</SPAN> Worksheet<br>    <br>    <SPAN style="color:#00007F">Set</SPAN> wsA = Sheets("SheetA")<br>    <SPAN style="color:#00007F">Set</SPAN> wsB = Sheets("SheetB")<br>    <br>    <SPAN style="color:#007F00">'set the output range to the first empty row in Sheet A</SPAN><br>    <SPAN style="color:#00007F">Set</SPAN> rOut = wsA.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)<br>    <br>    <SPAN style="color:#00007F">Set</SPAN> rF = wsB.Columns("K").Find(what:="???")<br>    <SPAN style="color:#00007F">Set</SPAN> r1st = rF<br>    <SPAN style="color:#00007F">Do</SPAN> <SPAN style="color:#00007F">While</SPAN> <SPAN style="color:#00007F">Not</SPAN> rF <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN><br>        <SPAN style="color:#007F00">'copy the row to sheet</SPAN><br>        rOut.Resize(1, 11).Value = rF.Offset(0, -10).Resize(1, 11).Value<br>        <SPAN style="color:#00007F">Set</SPAN> rOut = rOut.Offset(1, 0)<br>        <SPAN style="color:#00007F">Set</SPAN> rF = wsB.Columns("K").FindNext(after:=rF)<br>        <SPAN style="color:#00007F">If</SPAN> rF.Address = r1st.Address <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Do</SPAN><br>    <SPAN style="color:#00007F">Loop</SPAN><br>    <br>    <SPAN style="color:#007F00">'clean up</SPAN><br>    <SPAN style="color:#00007F">Set</SPAN> wsA = <SPAN style="color:#00007F">Nothing</SPAN><br>    <SPAN style="color:#00007F">Set</SPAN> wsB = <SPAN style="color:#00007F">Nothing</SPAN><br>    <SPAN style="color:#00007F">Set</SPAN> rF = <SPAN style="color:#00007F">Nothing</SPAN><br>    <SPAN style="color:#00007F">Set</SPAN> r1st = <SPAN style="color:#00007F">Nothing</SPAN><br>    <SPAN style="color:#00007F">Set</SPAN> rOut = <SPAN style="color:#00007F">Nothing</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0
If you have headers in SHEET B, a query table is one way. Via menu ALT-D-D-N.

Or an advanced filter is handy for this sort of task but can only copy to the same sheet as the source data. It would require an extra step, or a VBA approach, to have the data go to sheet A.

HTH
 
Upvote 0
When in the VBA editor right click on Workbook under your workbook name in the top lefthand panel. The workbook module will open. In the left drop down menu above the edit area select workbook and in the right drop down select open.
A skeleton macro is written which you need to complete, so just put the name of the macro in here.
Press F5 to see if it works.
Then save close and open to see if no errors appear.
 
Upvote 0
By the way, if using a query table no program code is required. You just set the query's property to run on file open. Right click from the table and look for the options, set to refresh on file open. cheers
 
Upvote 0

Forum statistics

Threads
1,216,181
Messages
6,129,355
Members
449,506
Latest member
nomvula

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