Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

show tick and acrossing mark in listbox and combobox

0

Hello,

I would show right,wrong marks in combobox1 and in last column in listbox1 based on showing in column I

currently show O,P letters , how can I fix it please?

thanks

Answer
Discuss

Discussion

@Abdo M,

As John has mentioned, a ListBox or ComboBox can only one font setting. You can search all you want for a way to do it as you prefer, but you will find it will be a waste of your time. You will need to add ListBoxes as I have done in my attached file.
But if you don't care for my solution, then I wish you luck in you search.

Cheers   :-)
WillieD24 (rep: 707) Nov 1, '25 at 2:18 pm
Add to Discussion

Answers

0
Selected Answer

Abdo

I think Willie's solution is good but If you don't like it, a solution would be to set column I to a regular font (instead of Webdings2) and use the square root symbol (√) for a tick (or check) and "x" for your cross. Better still, use data validation on column I to limit inputs to those values. 

Your ListBox1 uses Tahoma font currently so will show √ and x values. 

Revision #1, 02 November 2025

In the attached file, ListBox1 contains only the data rows- the headers are in a (seemingly) transparent ListBox3, above and grouped with it (so resizes if you change the width say).

In the worksheet, cell !1 uses your font but the bordered cells below that use Tahoma font (like ListBox1) since it displays the square root symbol correctly. Those cells have (List) Data Vaidation so a dropdown list lets you pick √ easily.

I added two new rows without entries in column A but if you click the button "Launch form" these will be displayed (and you can select a complete row).

It does that since I changed the way VBA finds the last used row (if your headers are in row 1)- see below, with comments:

Private Sub UserForm_Initialize()
   Dim LastRow As Long, Cols As String

    LastRow = Range("A1").CurrentRegion.Rows.Count 'find last used row (don't rely on column A in A
    Cols = "30;70;100;70;70;70;70;60;20" ' set common widths

    With ListBox1
        .ColumnCount = 9 ' make columns
        .ColumnWidths = Cols  ' fix common column widths
        .List = Range("A2:I" & LastRow).Value    ' get data
    End With

    With ListBox3
        .ColumnCount = 9 ' make header columns
        .ColumnWidths = Cols  'fix common column widths
        .List = Range("A1:I1").Value    ' get headings
    End With

End Sub

Hope this helps.

Discuss

Discussion

I suspect you & willie understand me , because Willie's file doesn't deal with new rows contains tic and crossing!
the file will add new data and add new marks so should show in listbox automatically.
Abdo M (rep: 24) Nov 1, '25 at 4:58 pm
@ Abdo M,

I just tested my file by adding 5 new entries and it worked fine. I suspect that when you tested it (added entries) you didn't add numbers in column "A". The line of code:
    LastRow = Sheets("ASS").Range("A" & Rows.Count).End(xlUp).Row
returns the row number of the last cell incolumn "A". If you omit the list numbers in column "A" it will return "7". It's imperitive to add numbers in column "A" to get the complete results.

I have added 5 entries to my file and updated my attachment. Download my file againg and you will see that it works.
Cheers   :-)
WillieD24 (rep: 707) Nov 1, '25 at 5:44 pm
'Willie- suspect you're right- Abdo's code relies on column A being populated.  I didn't understand Abdo's comment about your solution not adding new rows (save for the omission of extra content in rcolumn A fo rthe new rows).
00 
Abdo- please check Willie's comment/ file and (if you are satisfied) select Willie's Answer (or mine, if you find it easier with your original code).
John_Ru (rep: 6762) Nov 1, '25 at 5:58 pm
Willie
I think marks need formatting correctly 
select mark in listbox3 and select correspond  item in listbox1  you will notice is not in correct location .
Abdo M (rep: 24) Nov 2, '25 at 3:29 am
Abdo, your comment above would be better under Willie's Answer really but please see Revision #1 to my Answer (and working file)
John_Ru (rep: 6762) Nov 2, '25 at 8:15 am
@Abdo M,
I see what you mean. All that was needed was to adjust the height of ListBox3. I have attached file CHECKMARKS Rev1-B to my answer. Hopefully this is what you are wanting. If so, please mark my answer as Selected.

Cheers   :-)
WillieD24 (rep: 707) Nov 2, '25 at 10:41 am
@John show strange symbols in listbox3!
by the way I got solutions by others members in other forum.
@Wille I don't think there is big difference for your last updating.
Abdo M (rep: 24) Nov 2, '25 at 1:55 pm
Abdo, I'm confused. ListBox 3 is the headers (now above the white ListBox1) and uses Tahoma font (a standard Windows font), like column I. Do you have that font installed? If so, both ListBox1 and column I should show √ and x values. (If not, the results are unpredictable.)
John_Ru (rep: 6762) Nov 2, '25 at 2:21 pm
in column I,listbox3   font should be Wingdings 2  and this is what I have.
Abdo M (rep: 24) Nov 2, '25 at 2:26 pm
Abdo. it is NOT WebDings2 in my alternative approach (using Tahoma in column I). Did you try my file?

If you insist on WebDings2 then follow Willie's solution instead.
John_Ru (rep: 6762) Nov 2, '25 at 2:44 pm
@Abdo M,
I disagree with your comment   "@Wille I don't think there is big difference for your last updating."
Be sure you are opening "CHECKMARKS Rev1-B". In that file the blue highlight in ListBox1 aligns perfectly with the blue highlight in ListBox3.
Let John and I know if you are going to use one of our answers or something else.
WillieD24 (rep: 707) Nov 2, '25 at 3:07 pm
my alternative approach (using Tahoma in column I). Did you try my file?
OMG John this is super fantastic!
my apologies I thought just to  provided me the code , I don't notice your attcahment.
I don't know there are marks in Tahoma font , so no need using WebDings2 
but I have question why you recommend using willie's solution as long you have what I want instead of add multiple listboxes?
thank you so much.
Abdo M (rep: 24) Nov 2, '25 at 3:36 pm
Glad you liked it, thanks for selecting my Answer, Abdo.

I recommended Willie's Answer because it was good and matched my initial solution.. One downside was that extra work would be needed to select a whole row (all columns) if an entry was selected in either of  the two data listboxes. Please note Tahoma doesn't have a tick character really but the square root symbol looks quite close.
John_Ru (rep: 6762) Nov 2, '25 at 3:50 pm
I disagree with your comment
you can see last row in listbox contains tick in listbox3 without there is correspond in listbox1 and track tick one by one the user can't distinquish  which tick is relating with corrspond item in listbox1.
Abdo M (rep: 24) Nov 2, '25 at 3:51 pm
@Abdo M
You must be doing something wrong. There are 11 entries in ListBox1. Listbox3 has 10 entries starting with Item 2 (AVBGFTRY 201), with no "CASE" entry for Item 1 (AVBGFTRY 200) in ListBox1 (as per Worksheet "ASS"). Everything lines up perfectly, so there is no confusion.
Nonetheless, I'm glad you finally made a decision.
WillieD24 (rep: 707) Nov 2, '25 at 4:52 pm
Add to Discussion
0

Hello again Abdo M,

If you look at a cell in Column "I" you will see the font is set to "Windings2". In Wingdings2 an "O" shows as an "X" and a "P" shows as a checkmark. If that is what you want in your userform then do the following:

In the VB Editor open the userform. Select "ComboBox1" on the form. Then in the properties window at the left scroll down to "Font" and change the setting from "Tahoma" to "Wingdings2".

Doing this for "ListBox1" will fix things for the "Case" column but will create jibberish for all other columns. I don't know of a way to change the font for a single column in a ListBox. You would need to modify your form to have a second ListBox for colimn "I" data. Listbox1 would be for columns "A" thru "H". You could place ListBox2 beside ListBox1 so they appear as one ListBox.

UPDATE Oct 31 19:45

While updating your file to have the userform show the details as you prefer, I realized I had to add 2 ListBoxes. One to serve as the header "CASE" and the second to list the checkmarks and X's. I also had to increase the font size in ListBox3 to 9 so everything lines up nicely.

I have attached my revision so you can see how things look.

UPDATED Nov. 2/25   10:44

Added file CHECKMARKS Rev1-B.xlsm

If this solves things for you please mark my answer as Selected.

Cheers   :-)

Discuss

Discussion

Thanks 
I don't want adding  new listbox, I believe there is way to do that in the same listbox and I still search in the internet but so far no result !
Abdo M (rep: 24) Nov 1, '25 at 12:22 am
@Abdo

You can't set the font of a column within a Listbox (or Combobox) - it's all one font. I think you would just waste more time if yuou searched for a way in VBA.

Don't expect an Answer from me - i did something very similar to Willie but set the border colour like the background and made the last "column" slighly overlap the data Listbox (so it looked like one big Listbox)..If you select an item hgowever, the tick or cross isn't selected (but you could get around that if you really needed to).

@Willie - good work! I was out last night and didn't spot that your revision gave the solution I was thinking of.
John_Ru (rep: 6762) Nov 1, '25 at 1:51 pm
Hi John,
you wanna say it's impossible  by vba ?
Abdo M (rep: 24) Nov 1, '25 at 2:36 pm
Abdo, yes that's what I said. Willie's solution (or similar) is as close as you'll get.

Did you try his file? You could use my suggestions above too (but only for a slightly better look).
John_Ru (rep: 6762) Nov 1, '25 at 3:53 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login