January 11, 2019
Hello everyone,
Please i need help.
TABLE 1 | ||
NO 1 | NO 2 | NO 3 |
23 | 36 | 15 |
44 | 20 | 8 |
52 | 23 | 99 |
TABLE 2 | ||
NO 1 | NO 2 | NO 3 |
41 | 15 | 87 |
22 | 8 | 93 |
35 | 67 | 56 |
Table one above shows a pattern in which 8 is under 15 under NO3. Now table 2 is equally showing similar pattern in which 8 is under 15 in NO2. I want to be able to search my entire workbook so that if i want to check where 8 is under 15 anywhere in my workbook, it will highlight it and refer me to the sheet where same pattern appears.
Please help. Thanks
Trusted Members
December 20, 2019
Its much easier if you add a workbook instead of screen dumps/text.
Try the attached, you need to select the grid you want to check then click the button. The numbers to check can be changed in K2 & k3
Sub CheckUnder()
Dim Top As Integer
Dim Bottom As Integer
Dim r As Range
Dim c As Range
Top = Range("k2")
Bottom = Range("k3")
Set r = Selection
For Each c In r
If c.Value = Top And c.Offset(1, 0) = Bottom Then
c.Offset(1, 0).Interior.Color = vbRed
c.Offset(1, 0).Font.Color = vbWhite
End If
Next c
End Sub
January 11, 2019
hello Purfleet,
thanks so much for your response. much appreciated. However, kindly find attached the problem i am looking for solution for. in the attached, Column A to J will not change. they are static. I want a situation whereby when I enter a pattern according to column M to Q, if that pattern is available in the work book (Different sheet that I will be adding those number data), it should direct me there. Column A to J will not change.
Thanks as I look forward to your help bro.
Trusted Members
December 20, 2019
Trusted Members
December 20, 2019
It not complete, but i think it captures the concept
- You put the pattern to look for in L to U 1 or 2 rows (note this is a 1 to 10 grid and they must be in the correct columns)
- a formula will appear in column W
- then the cells are highlighted
I know you have multiple sheets, but is this the basic idea?
Would be interested if anyone else had better ways of doing it as i have been down numerous rabbit holes!
January 11, 2019
Hello Purfleet,
I really do not know how to thank you for this. This is great. You got the whole concept perfectly. It is working amazingly bro and this is exactly what i need.
The extra behavior that i need on the sheet are;
1. I want up to 4 parameters i.e 4 rows maximum like you stated in your point 1 of your last reply. (I have shown it in the sheet (AB - AV)
2. I may decide to create extra column in-between the columns (I have shown example in the attached sheet. Column A,B & H newly created). The addition of columns shouldn't affect the macro. KINDLY NOTE: macro will only run on NO1 TO NO10 ONLY. It will not run on any other column
3. Like I said before, i have multiple sheets and the data in each of those sheets are endless. So, I want the macro to check for any pattern in all my sheets.
This is the only thing needed. Once these are done, then its is fine.
Once again, thanks so much. You are really good.
Regards,
Vic Man
January 11, 2019
Hello Purfleet,
Trust you are well and doing fine.
I haven't heard from you since the last time and i was wondering if you are okay. Sorry to bother you but please, did you by any chance saw my last message before this one and the attachment?
Hope to hear from you soon.
Thanks
Vic Man
Trusted Members
December 20, 2019
Yes i did see it and noticed that the requirements were changed again, so from a 'fairly easy find 1 number below another' or a far more complex' find various numbers in a grid' to 'find even more numbers in a grid with another number inbetween'!
I will have a look but i cant guarantee when
January 11, 2019
Hello Purfleet,
Thanks for your response. I will wait till you are able to help me solve this.
Meanwhile, the extra column which i inserted (H) is just a total of NO1 to NO5. Better still, if that will be an issue, you can remove it and then make the search parameters to be just 4 rows maximum. I am makin it 4 rows just in case i decide to search for more number patterns.
Thanks
Vic Man
1 Guest(s)