A script to match criteria

Jeff P

Board Regular
Joined
Jun 11, 2011
Messages
80
I have a double column "BC" which was made into a range ("MarkerRange") that contains an assortment of markers ID's to identify common rows.
as an example:

XT
00
FF
SU
ZZ
FF
0
XX
FF

In some cases the marker ID is a single character, or double, or only a solid color, or a color with a unique boarder color or just a pattern etc..
I have also created a drop down menu in cells JK, range ("MarkerID") which points to the list of marker IDs

Is it possible to create a "script" which will say: If the value "and" formatting from range ("MarkerID") matches anywhere in ("MarkerRange")
to place an "X" 3 colums to the right?

as an example:. if "FF" is selected in ("MarkerID") drop down menu

XT
00
FF x
SU
ZZ
FF x
0
XX
FF x

I have similar scripts which identify values, but none that include exact formatting.

Thanks for any help

Jeff
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Double column meaning that I have a range comprised of columns B and C,
in which the marker ID's may encompass both column B and C

ABCDEF

..XT
..00
..FF
..SU
..ZZ
..FF
..0
..XX
..FF


thanks
 
Upvote 0
Unclear. There are two cases:
1. Value "XT" is in merged cell "B1:C1".
2. Value "X" - in B1, value "T" - in C1.
Which one?
 
Upvote 0
Thanks Sektor.. i appreciate your patience.

They are not merged cells
So i guess they would be considered their own cell containing a unique value and formatting.
Although I view them as one marker, they are actually two cells side by side

If it makes things easier.. I can remake my sheet to encompass only a single column. (perhaps its better that way)

If you could make a script to that looks through only a single column ie: B: Range ("MarkerRange) .. that would be great!

My initial concern was to create a script which can distinguish between, say a value, and the same value with a different font formatting, or just a solid color. etc.

If that's possible?



so to re iterate keeping with only a single column

here would be my example beginning with:

ABCD
..X
..0
..F
..S
..Z
..F
..0
..X
..F

and to search for "F"

ABCD
..X
..0
..F X
..S
..Z
..F X
..0
..X
..F X

Thanks
 
Upvote 0
So, you just want to place "X" sign against ID which you selected in "MarkerRange"? Correct?
 
Upvote 0
Correct.

to place an "X" 3 spaces to the left that matches the exact value and formatting.

As an example, if I chose to identify "F" it will not include the non formated "F", as it is not an exact match.

example:

ABCD
..X
..0
..F
..S
..Z
..F x
..0
..X
..F x

sorry for any confusion.. and thanks for the help.
 
Upvote 0
I don't know why you decided that colored values aren't searchable, but following code works for me. I place your data into column B (replace "F" with the value you search):

Code:
Sub SetXes()
    Columns("B:B").Replace What:="F", Replacement:="F   x"
End Sub
 
Upvote 0
Thanks Sektor

But I may have made things more confusing.
What I'm looking for is a script which will identify a value (and format), and place an "x" 3 cells to the right...within column E
I quickly tested your script, which places an "X" three "spaces" to the right, keeping them in the same cell.

sorry if my example wasn't quite clear..

Also your script does not distinguish between formatting. If I have a red F and a green F it will place an X beside both
I am in need of a script which can distinguish between any value and formatting.

ie: In one case may be trying to indicate all Blue " F"s, in another case I may want to identify all green Z's with a bold font and a blue background.
or I may want to indicate only the cells with yellow fill.

thanks again for the help.
 
Upvote 0
It ain't problem to identify font color. The problem is WHICH colors you want to search for? Interior.Font has two properties for color: Color and ColorIndex. ColorIndex takes number. Color takes RGB function. You must figure out numbers of colors.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,351
Members
452,907
Latest member
Roland Deschain

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