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.[TABLE="width: 896"]
<tbody>[TR]
[TD][/TD]
[TD]SHEET A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 13:45[/TD]
[TD="align: right"]6/2/2014 21:08[/TD]
[TD="align: right"]6/3/2014 17:28[/TD]
[TD="align: right"]6/4/2014 17:21[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/5/2014 9:26[/TD]
[TD]MSCSSC2[/TD]
[TD="align: right"]6/5/2014 19:30[/TD]
[TD]DCOWAN[/TD]
[TD="align: right"]1250[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 11:20[/TD]
[TD="align: right"]6/2/2014 12:42[/TD]
[TD="align: right"]6/2/2014 15:10[/TD]
[TD="align: right"]6/2/2014 15:55[/TD]
[TD]MHARRIS[/TD]
[TD="align: right"]6/2/2014 17:43[/TD]
[TD]BHUMPHRE[/TD]
[TD="align: right"]6/3/2014 15:40[/TD]
[TD]TEJONES[/TD]
[TD="align: right"]252[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 10:37[/TD]
[TD="align: right"]6/2/2014 11:39[/TD]
[TD="align: right"]6/3/2014 18:30[/TD]
[TD="align: right"]6/3/2014 19:04[/TD]
[TD]PORTIZ[/TD]
[TD="align: right"]6/4/2014 14:09[/TD]
[TD]CHART[/TD]
[TD="align: right"]6/4/2014 16:19[/TD]
[TD]AGUILLEB[/TD]
[TD="align: right"]1100[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 13:45[/TD]
[TD="align: right"]6/2/2014 19:57[/TD]
[TD="align: right"]6/3/2014 12:45[/TD]
[TD="align: right"]6/3/2014 13:03[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/3/2014 16:52[/TD]
[TD]SDAWSON[/TD]
[TD="align: right"]6/4/2014 20:09[/TD]
[TD]DCOWAN[/TD]
[TD="align: right"]110[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]SHEET B[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 12:29[/TD]
[TD="align: right"]6/2/2014 17:28[/TD]
[TD="align: right"]6/2/2014 18:02[/TD]
[TD="align: right"]6/3/2014 14:19[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/3/2014 15:53[/TD]
[TD]SDAWSON[/TD]
[TD="align: right"]6/5/2014 9:00[/TD]
[TD]AGUILLEB[/TD]
[TD="align: right"]98[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 11:20[/TD]
[TD="align: right"]6/2/2014 20:10[/TD]
[TD="align: right"]6/3/2014 8:46[/TD]
[TD="align: right"]6/3/2014 15:25[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/4/2014 15:58[/TD]
[TD]SDAWSON[/TD]
[TD="align: right"]6/5/2014 15:15[/TD]
[TD]AGUILLEB[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 11:20[/TD]
[TD="align: right"]6/2/2014 13:02[/TD]
[TD="align: right"]6/2/2014 18:48[/TD]
[TD="align: right"]6/3/2014 9:20[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/3/2014 9:29[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/3/2014 12:35[/TD]
[TD]DPEPPERS[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 13:45[/TD]
[TD="align: right"]6/2/2014 21:08[/TD]
[TD="align: right"]6/3/2014 17:28[/TD]
[TD="align: right"]6/4/2014 17:21[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/5/2014 9:26[/TD]
[TD]MSCSSC2[/TD]
[TD="align: right"]6/5/2014 19:30[/TD]
[TD]DCOWAN[/TD]
[TD="align: right"]1250[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 11:20[/TD]
[TD="align: right"]6/2/2014 12:42[/TD]
[TD="align: right"]6/2/2014 15:10[/TD]
[TD="align: right"]6/2/2014 15:55[/TD]
[TD]MHARRIS[/TD]
[TD="align: right"]6/2/2014 17:43[/TD]
[TD]BHUMPHRE[/TD]
[TD="align: right"]6/3/2014 15:40[/TD]
[TD]TEJONES[/TD]
[TD="align: right"]252[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 13:45[/TD]
[TD="align: right"]6/2/2014 19:57[/TD]
[TD="align: right"]6/3/2014 12:06[/TD]
[TD="align: right"]6/3/2014 14:07[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/3/2014 15:55[/TD]
[TD]SDAWSON[/TD]
[TD="align: right"]6/5/2014 9:09[/TD]
[TD]CMACOMSO[/TD]
[TD="align: right"]75[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 10:37[/TD]
[TD="align: right"]6/2/2014 11:39[/TD]
[TD="align: right"]6/3/2014 18:30[/TD]
[TD="align: right"]6/3/2014 19:04[/TD]
[TD]PORTIZ[/TD]
[TD="align: right"]6/4/2014 14:09[/TD]
[TD]CHART[/TD]
[TD="align: right"]6/4/2014 16:19[/TD]
[TD]AGUILLEB[/TD]
[TD="align: right"]1100[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 11:20[/TD]
[TD="align: right"]6/2/2014 13:02[/TD]
[TD="align: right"]6/3/2014 14:53[/TD]
[TD="align: right"]6/3/2014 16:03[/TD]
[TD]ACLINKSC[/TD]
[TD="align: right"]6/3/2014 16:09[/TD]
[TD]BHUMPHRE[/TD]
[TD="align: right"]6/5/2014 10:58[/TD]
[TD]LHAMMOND[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD]SC[/TD]
[TD="align: right"]6/2/2014 13:45[/TD]
[TD="align: right"]6/2/2014 19:57[/TD]
[TD="align: right"]6/3/2014 12:45[/TD]
[TD="align: right"]6/3/2014 13:03[/TD]
[TD]JTRELA[/TD]
[TD="align: right"]6/3/2014 16:52[/TD]
[TD]SDAWSON[/TD]
[TD="align: right"]6/4/2014 20:09[/TD]
[TD]DCOWAN[/TD]
[TD="align: right"]110 [/TD]
[/TR]
</tbody><colgroup><col><col span="4"><col><col><col><col><col><col></colgroup>[/TABLE]
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
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,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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