Creating highlighting rules based on string values

VBA_PM

New Member
Joined
Sep 5, 2021
Messages
4
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hey all,

I'm doing some data analysis work on a bunch of spreadsheets and I'm seeking a way to automate part of the process.

The entire row is highlighted based on the string value in column I, there's many different string values I'll need to create rules for. The longest string I've counted is 59 characters. I've attempted different things but haven't had any luck creating functioning code for it. My knowledge with VBA is pretty minimal. Any guidance is greatly appreciated.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I suspect this can be done without VBA, and just conditional formatting. But I would need some details. What are the "many different string values"? Do you have a list someplace?

As an example suppose you have a list of the string values in Sheet2 column A. Then you would select all the columns you want to highlight and add this conditional formatting rule, using a formula:

Excel Formula:
=ISNUMBER(MATCH($I1,Sheet2!$A:$A,0))

You mention a bunch of spreadsheets. I don't think CF rules can have references to external files. The way I would do this is to have one file with the list, and then in each file you want to analyze add a sheet that has external references to that file, and then use the above technique.

Of course, you could do this with VBA, but we need more detail about how you would want that to work in more than one file. If the above will not get you want you want, please explain what else you need that the above does not provide, details of the list of strings, what columns are included in the "the entire row".
 
Upvote 0
Solution
Thanks for the reply! I do not have a list at the moment, I started on one but I haven't finished it. I can however upload an example of one of my spreadsheets. This is just an image example for now, but I can upload an XL2BB example tonight if that would be helpful.

It is a good many spreadsheets.. I process about 200 of these spreadsheets at a time. But, I've been manually highlighting them for a long time now. So doing them individually isn't a big deal I just want to be a bit more efficient if possible. The highlighting portion is what takes the vast majority of time with these. Especially in some of the larger examples where there's over 20k rows.

As a quick breakdown the way these files are processed now goes:

Downloading the files one at a time from web service as CSV files > Use a VBA macro to convert to xls and save as a unique file > repeat for all files > Then I open each of them individually highlight the rows that contain certain values > Resave > Distribute

Certain things are highlighted red if they're a high priority error (contain an E in column F), and the other issues are highlighted in alternating yellow/orange. The alternating is optional, this is just done to make it a bit easier to distinguish between them.
 

Attachments

  • Annotation 2022-09-12 124031.jpg
    Annotation 2022-09-12 124031.jpg
    184.1 KB · Views: 7
Upvote 0
I should note, the reason I mentioned certain string values is because only some of the issues are highlighted.

There are cases where there will be data, but no highlighting should occur. It will all be dependent on what value is in column I.
 
Upvote 0
70420 noMRN.xlsx
ABCDEFGHIJK
14ProviderRepresentative Facility IDUserProfileImport Log IDError / WarnDate SentIssueIssue LocationMessage Control ID
1512345Testname.HL7128622837E7/6/2022 5:42patient id is missingPID-3
1612345Testname.HL7128622838E7/6/2022 5:42patient id is missingPID-3
1712345Testname.HL7128622891E7/6/2022 5:43Patient id was not found, must be of type 'MR'
1812345Testname.HL7128622892E7/6/2022 5:43Patient id was not found, must be of type 'MR'
1912345Testname.HL7128622893E7/6/2022 5:43Patient id was not found, must be of type 'MR'
2012345Testname.HL7128622894E7/6/2022 5:43Patient id was not found, must be of type 'MR'
2112345Testname.HL7128622895E7/6/2022 5:43Patient id was not found, must be of type 'MR'
2212345Testname.HL7128622906E7/6/2022 5:43Patient id was not found, must be of type 'MR'
2312345Testname.HL7128622907E7/6/2022 5:43Patient id was not found, must be of type 'MR'
2412345SIISCLIENT11Testname.HL7128802461W7/14/2022 11:30next of kin name first is invalidNK1-2.2
2512345SIISCLIENT11Testname.HL7128802701W7/14/2022 11:34next of kin name first is invalidNK1-2.2
2612345SIISCLIENT11Testname.HL7128824492W7/15/2022 10:10next of kin name first is invalidNK1-2.2
2712345SIISCLIENT11Testname.HL7128824494W7/15/2022 10:10next of kin name first is invalidNK1-2.2
2812345SIISCLIENT11Testname.HL7128825442W7/15/2022 10:29next of kin name first is invalidNK1-2.2
2912345SIISCLIENT11Testname.HL7128786419W7/13/2022 16:14next of kin name first is missingNK1-2.2
3012345SIISCLIENT11Testname.HL7128766451W7/13/2022 9:06next of kin name last is invalidNK1-2.1
3112345SIISCLIENT11Testname.HL7128786417W7/13/2022 16:14next of kin name last is invalidNK1-2.1
3212345SIISCLIENT11Testname.HL7128766215W7/13/2022 9:01next of kin name last is missingNK1-2.1
3312345SIISCLIENT11Testname.HL7128786419W7/13/2022 16:14next of kin name last is missingNK1-2.1
3412345SIISCLIENT11Testname.HL7128722256W7/11/2022 13:03next of kin phone is invalidNK1-5
3512345SIISCLIENT11Testname.HL7128724740W7/11/2022 13:52next of kin phone is invalidNK1-5
3612345SIISCLIENT09Testname.HL7128861332W7/18/2022 11:10next of kin phone is invalidNK1-5
3712345SIISCLIENT11Testname.HL7128861550W7/18/2022 11:15next of kin phone is invalidNK1-5
3812345SIISCLIENT09Testname.HL7128694329W7/8/2022 16:45patient first name is invalidPID-5.2
3912345SIISCLIENT11Testname.HL7128567455W7/1/2022 8:26patient mothers maiden name is missingPID-6
Provider_Detail_Error_Report (3
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,150
Members
453,021
Latest member
Justyna P

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