Number Search / return corresponding number strings

dwrowe001

Board Regular
Joined
Mar 12, 2017
Messages
53
Office Version
  1. 2016
Platform
  1. Windows
Yes, I am in need of and respectfully request assistance with my project... ..
I need help developing a VBA macro which will search a huge list of numbers for a specified number, then return a specified set of numbers and continue down the list searching for the specified number until it reaches the bottom. The number array I need to search 9761 rows, C4 to F9763....

Each time the specified number is found the macro should return the numbers to the right of it and also the two rows of numbers Below it.

So for example:
if I'm searching for the number 038, which I put in cell J2. I then would like to click a button (in I1 in my example), the search will start at the top of the list. The first instance of 038 (in cell B4)is in the first line.. so return 83, 10, and 05, and the two lines below, B5:E6. Duplicates should not be returned, but they shoiuld be noted as to how many have been found as indicated by numbers in columns H, J, L and N. So the 10 in Cell E5 is the second ten recorded, so the 2nd ten shouldn't be included in the list of numbers returned. just increment J4 to 2.

The second 038 found is on the 3rd line (Cell C6), so record 46, 62, 41, 32, 90 and 08. the numbers 23, 36 and 64 were previously recorded when the first 38 was found. So their Qty numbers in H5, N5 and H6 should be incremented by 1 each.

For the third 038 found (Cell E14) since there are no numbers to the right of it on the same line, just return the 2 rows below it. number 46 was previously found, and 75 was found in line in same group, so only return 1, and increment its Qty count in J11.

The 4th 038 found in this example was found on B17, return numbers 45 and 56, all the other numbers found were previously found, so increment their Qty numbers, don't list them.

The Colors I used in the example aren't needed.. I just did that for clarity.

I this makes sense and isn't asking to much?... I don't know if regular XCEL formulas can do what I would like to do. Thank you in advance for taking the time to review my request and helping.
Thank you
Dave R.
 

Attachments

  • Example 1.jpg
    Example 1.jpg
    112.3 KB · Views: 22
I will gladly help you, you could create a new thread in MrExcel, explain in detail and with examples what you have and what you want as a result.

Note XL2BB:
For the future, it would help greatly if you could give us the sample data in a form that we can copy to test with, rather that a picture.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in
Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

I Can't get the XL2BB feature to work for some reason... I can live with what I got from you. Thank you for your help.
Dave
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,223,883
Messages
6,175,168
Members
452,615
Latest member
bogeys2birdies

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