Changing colors of cards based on suits over multiple columns

Treys

New Member
Joined
Jul 4, 2021
Messages
5
Office Version
  1. 2019
Platform
  1. Windows
This was solved in a previous thread "s there a way to replace specific letters in a range of cells with symbols?".
However, i'm having some trouble getting the ranges correct. I would like to have three columns, one for each of the three cards. I've been playing around with the ranges in VBA but nothing seems to work.
Heres the vba code that gets it correct for one column:
1625403584239.png

This code resulted in this:
1625403776540.png

I would like to split the cards like this:
1625403653274.png

As you can see, i only get colours on the first column. Would love to get some feedback on this, and if possible a little explanation so that i can understand this. Pretty frustrating when nothing seems to work haha.
Cheers!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi & welcome to MrExcel.

Can you post some sample data of what you start with.

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.
 
Upvote 0
Suits done.xlsm
AB
1A♠ 3♠ 2♦
28♠ 4♠ 2♦
3A♠ 4♠ 2♦
46♠ 5♠ 2♦
5J♠ 5♠ 2♦
6T♠ 7♠ 2♦
7K♠ 8♠ 2♦
8Q♠ 8♠ 2♦
9A♠ T♠ 2♦
10Q♠ T♠ 2♦
116♣ 2♠ 2♦
12T♣ 2♠ 2♦
135♣ 3♦ 2♠
146♣ 3♦ 2♠
157♣ 3♦ 2♠
167♠ 3♦ 2♠
17K♠ 3♦ 2♠
18Q♣ 3♦ 2♠
194♠ 3♠ 2♠
209♦ 3♠ 2♠
215♣ 4♦ 2♠
229♣ 4♦ 2♠
237♦ 4♠ 2♠
246♠ 5♦ 2♠
25J♠ 5♦ 2♠
26T♣ 5♦ 2♠
27J♣ 6♦ 2♠
288♦ 6♠ 2♠
29Q♦ 6♠ 2♠
309♠ 7♦ 2♠
31A♠ 7♦ 2♠
32T♣ 7♦ 2♠
33A♣ 8♦ 2♠
34K♣ 8♦ 2♠
35T♣ 8♦ 2♠
36T♠ 8♠ 2♠
37Q♠ J♦ 2♠
38K♦ Q♠ 2♠
39Q♣ T♦ 2♠
405♠ 4♠ 3♦
418♠ 5♠ 3♦
42A♠ 6♠ 3♦
43J♠ 8♠ 3♦
44A♠ J♠ 3♦
45K♠ Q♠ 3♦
468♠ 3♠ 3♦
47J♣ 3♠ 3♦
48A♣ 4♦ 3♠
49J♣ 4♦ 3♠
50K♠ 4♦ 3♠
516♠ 4♠ 3♠
52A♣ 5♦ 3♠
53J♦ 5♠ 3♠
54K♣ 6♦ 3♠
559♦ 6♠ 3♠
568♣ 7♦ 3♠
578♠ 7♦ 3♠
58A♣ 7♦ 3♠
59Q♣ 7♦ 3♠
60A♦ 7♠ 3♠
61J♠ 7♠ 3♠
629♣ 8♦ 3♠
63T♣ 9♦ 3♠
64Q♠ 9♠ 3♠
65A♠ Q♠ 3♠
66A♣ T♦ 3♠
67K♦ T♠ 3♠
68A♠ 5♠ 4♦
69T♠ 5♠ 4♦
708♠ 6♠ 4♦
71Q♠ 7♠ 4♦
729♠ 8♠ 4♦
73J♠ 9♠ 4♦
744♠ 4♦ 3♣
75K♣ 4♠ 4♦
76K♣ 5♦ 4♠
77K♠ 5♦ 4♠
78K♦ 5♠ 4♠
797♠ 6♦ 4♠
809♣ 6♦ 4♠
81A♣ 6♦ 4♠
82K♣ 6♦ 4♠
83Q♣ 6♦ 4♠
84J♠ 6♠ 4♠
858♣ 7♦ 4♠
86T♦ 7♠ 4♠
87J♣ 8♦ 4♠
88Q♣ 8♦ 4♠
89Q♣ 9♦ 4♠
90J♠ 9♠ 4♠
91Q♣ J♦ 4♠
92J♣ T♦ 4♠
93A♦ T♠ 4♠
947♠ 6♠ 5♦
958♠ 6♠ 5♦
968♠ 7♠ 5♦
979♠ 7♠ 5♦
98Q♠ J♠ 5♦
997♣ 5♠ 5♦
1008♠ 6♦ 5♠
101A♣ 6♦ 5♠
102J♣ 6♦ 5♠
103K♠ 6♠ 5♠
1049♠ 7♦ 5♠
105A♠ 7♠ 5♠
106Q♦ 7♠ 5♠
1079♣ 8♦ 5♠
108A♠ 8♠ 5♠
109K♣ 9♦ 5♠
110Q♠ 9♦ 5♠
111Q♦ 9♠ 5♠
112T♦ 9♠ 5♠
113A♦ J♠ 5♠
114A♣ T♦ 5♠
115K♠ T♦ 5♠
116Q♣ T♦ 5♠
117Q♦ T♠ 5♠
118A♠ T♠ 6♦
1198♠ 6♠ 6♦
1209♣ 6♠ 6♦
1219♠ 6♠ 6♦
122J♠ 6♠ 6♦
123A♣ 7♦ 6♠
124T♣ 7♦ 6♠
125K♦ 7♠ 6♠
1269♣ 8♦ 6♠
127Q♠ 8♦ 6♠
128T♠ 8♦ 6♠
129T♠ 9♦ 6♠
130A♠ 9♠ 6♠
131K♠ J♦ 6♠
132A♣ Q♦ 6♠
133K♠ Q♠ 6♠
134J♣ T♦ 6♠
135A♠ K♠ 7♦
136K♠ Q♠ 7♦
137Q♣ 7♠ 7♦
138T♠ 7♠ 7♦
139J♣ 8♦ 7♠
140T♦ 8♠ 7♠
141J♣ 9♦ 7♠
142K♠ 9♠ 7♠
143A♠ Q♦ 7♠
144A♦ Q♠ 7♠
145K♦ Q♠ 7♠
146A♣ T♦ 7♠
147A♠ K♠ 8♦
1488♠ 8♦ 3♠
149T♣ 8♠ 8♦
150T♠ 9♦ 8♠
151A♦ 9♠ 8♠
152K♣ J♦ 8♠
153A♦ K♠ 8♠
154J♠ T♦ 8♠
155J♠ T♠ 9♦
1569♠ 9♦ 3♣
1579♠ 9♦ 3♠
158A♣ 9♠ 9♦
159Q♣ J♦ 9♠
160A♠ K♦ 9♠
161A♦ Q♠ 9♠
162K♦ Q♠ 9♠
163A♦ T♠ 9♠
164A♠ A♦ 5♣
165A♠ A♦ A♣
166A♠ A♦ J♠
167J♣ 8♦ 4♠
168A♠ Q♠ J♦
169J♠ J♦ 4♣
170J♠ J♦ 5♣
171J♠ J♦ 7♣
172A♦ K♠ J♠
173K♣ Q♦ J♠
174K♠ K♦ 4♠
175K♠ K♦ 6♣
176K♠ K♦ 9♣
177A♠ K♠ K♦
178K♠ K♦ T♣
179A♠ K♦ Q♠
180Q♠ Q♦ 3♣
181Q♠ Q♦ 8♠
182Q♠ J♠ T♦
183K♠ J♠ T♠
184T♠ T♦ 5♣
185T♠ T♦ T♣
Sheet1
 
Upvote 0
Suits done.xlsm
ABC
67K♦T♠3♠
68A♠5♠4♦
69T♠5♠4♦
708♠6♠4♦
71Q♠7♠4♦
729♠8♠4♦
73J♠9♠4♦
744♠4♦3♣
75K♣4♠4♦
76K♣5♦4♠
77K♠5♦4♠
78K♦5♠4♠
797♠6♦4♠
809♣6♦4♠
81A♣6♦4♠
82K♣6♦4♠
83Q♣6♦4♠
84J♠6♠4♠
858♣7♦4♠
86T♦7♠4♠
87J♣8♦4♠
88Q♣8♦4♠
89Q♣9♦4♠
90J♠9♠4♠
91Q♣J♦4♠
92J♣T♦4♠
93A♦T♠4♠
947♠6♠5♦
958♠6♠5♦
968♠7♠5♦
979♠7♠5♦
98Q♠J♠5♦
997♣5♠5♦
1008♠6♦5♠
101A♣6♦5♠
102J♣6♦5♠
103K♠6♠5♠
1049♠7♦5♠
105A♠7♠5♠
106Q♦7♠5♠
1079♣8♦5♠
108A♠8♠5♠
109K♣9♦5♠
110Q♠9♦5♠
111Q♦9♠5♠
112T♦9♠5♠
113A♦J♠5♠
114A♣T♦5♠
115K♠T♦5♠
116Q♣T♦5♠
117Q♦T♠5♠
118A♠T♠6♦
1198♠6♠6♦
1209♣6♠6♦
1219♠6♠6♦
122J♠6♠6♦
123A♣7♦6♠
124T♣7♦6♠
125K♦7♠6♠
1269♣8♦6♠
127Q♠8♦6♠
128T♠8♦6♠
129T♠9♦6♠
130A♠9♠6♠
131K♠J♦6♠
132A♣Q♦6♠
133K♠Q♠6♠
134J♣T♦6♠
135A♠K♠7♦
136K♠Q♠7♦
137Q♣7♠7♦
138T♠7♠7♦
139J♣8♦7♠
140T♦8♠7♠
141J♣9♦7♠
142K♠9♠7♠
143A♠Q♦7♠
144A♦Q♠7♠
145K♦Q♠7♠
146A♣T♦7♠
147A♠K♠8♦
1488♠8♦3♠
149T♣8♠8♦
150T♠9♦8♠
151A♦9♠8♠
152K♣J♦8♠
153A♦K♠8♠
154J♠T♦8♠
155J♠T♠9♦
1569♠9♦3♣
1579♠9♦3♠
158A♣9♠9♦
159Q♣J♦9♠
160A♠K♦9♠
161A♦Q♠9♠
162K♦Q♠9♠
163A♦T♠9♠
164A♠A♦5♣
165A♠A♦A♣
166A♠A♦J♠
167J♣8♦4♠
168A♠Q♠J♦
169J♠J♦4♣
170J♠J♦5♣
171J♠J♦7♣
172A♦K♠J♠
173K♣Q♦J♠
174K♠K♦4♠
175K♠K♦6♣
176K♠K♦9♣
177A♠K♠K♦
178K♠K♦T♣
179A♠K♦Q♠
180Q♠Q♦3♣
181Q♠Q♦8♠
182Q♠J♠T♦
183K♠J♠T♠
184T♠T♦5♣
185T♠T♦T♣
Sheet4
 
Upvote 0
Hope these are better! Let me know if i can post anything else that may be helpful :)
 
Upvote 0
Thanks for that.
With the 2nd example
VBA Code:
Sub Treys()
   Dim Cl As Range
   
   For Each Cl In Range("A1").CurrentRegion
      Select Case AscW(Right(Cl.Value, 1))
         Case 9829: Cl.Characters(2, 1).Font.ColorIndex = 3
         Case 9830: Cl.Characters(2, 1).Font.ColorIndex = 23
         Case 9827: Cl.Characters(2, 1).Font.ColorIndex = 50
         Case 9824: Cl.Characters(2, 1).Font.ColorIndex = 1
      End Select
   Next Cl
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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