Userform Listbox

johnohio

New Member
Joined
May 12, 2005
Messages
48
Office Version
  1. 2016
Platform
  1. Windows
I am working on a userform with a listbox of 2 items.. Cash In and Cash Out.
It works OK but the Cash In has dotted lines around it.

I have never seen this before. How do I get rid of the dotted lines?

Thanks Everyone



VBA Code:
Private Sub UserForm_Initialize()
   
    With UserForm1.ListBox1
        .AddItem "Cash In/Income  "
        .AddItem "Cash Out/Expense"
   End With

End Sub
 

Attachments

  • p1.GIF
    p1.GIF
    4.9 KB · Views: 5
  • p2.GIF
    p2.GIF
    4.5 KB · Views: 5

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
That's because "In" is the first record in the listbox.

1688177624176.png


And it is dotted as the number 1 item in the listbox. To identify the cursor in the listbox.

If you had another control, for example a textbox, and the cursor was in the textbox, then the listbox would not present that dotted box.

1688177779667.png
 
Upvote 0
@johnohio
I just want to comment on something, if the purpose of the listbox is to select an item from a list then using a combobox is more suitable.
 
Upvote 1
Solution
You're welcome, glad to help & thanks for the feedback.:)
 
Upvote 0

Forum statistics

Threads
1,216,111
Messages
6,128,898
Members
449,477
Latest member
panjongshing

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