Comparing two ID's values on unique named entities in VBA - Then highlight & show rule violations

MurdochQuill

Board Regular
Joined
Nov 21, 2020
Messages
84
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have a challenge where I am dealing with large sets of data for an astronomy project (mapping anomolous planets)! I would prefer not to do any Vlookups, as there is currently a cell-by-cell approach to comparing this array that is very slow.

I'm trying to compare the ID's in col B according to sets of rules in col N. I would preferably like to include a dictionary of rules for these data comparisons, or pop them into a VBA module as a large list of rules, as there may be upwards of 50 - 200. The datasets of planet names may be up to 500 or more columns, and there may be up to 500 rows of ID's. Also note, the ID's will always change position with each new dataset, but I would like them to follow the logged rules wherever they may be. The planet names will also change on each new dataset, but these will never have rules attached as there will be a huge amount of planets being listed which may all be unique.

Basically, I'm trying to flag the values which violate rules in col N in the array, and populate another column with the results of the violations.

Please see below as an example of what a small table may look like.

Book2
BCDEFGHIJKLMN
1NAMES OF PLANETS/STARS ETC
2ID: SaturnJupiterSolEarthMercuryMarsMars IINeptuneFlagged Names:Rule Dictionary:
3AA338251917294631Jupiter (AA>FD)AA>FD
4FD8201221431620Earth (AA>FD)AA+FD=HG +/- 20%
5HG47417820133012Mercury (AA>FD)DF+V= <HY
6DF202722222242231Jupiter (DF+V= <HY)etc
7VC502413361311042Sol (DF+V= <HY)etc
8HY1646314232463138Earth (DF+V= <HY)etc
9GHF474520451836411Mercury (DF+V= <HY)
10FGJHG183281641132912Mars (DF+V= <HY)
11SR36434332626334Mars II (DF+V= <HY)
12EWTR354218126103122Neptune (DF+V= <HY)
13HGF5043232337383746
14UYK113521332354725
15CVB210273733492631
Sheet1


Fyi I would love to have this 100% in VBA, and if anyone has some genius ideas on comparing this data while being light on CPU usage would be a godsend!!!
& any links that may be valuable for learning how to optimize my VBA code for CPU usage would be appreciated.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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