

You can change the Border Style according to your wish or requirement from the available option list.On the right side you can find two options.On the left side find ‘BorderStyle’ from the available List Box properties.Now you can find the properties window of listbox on the screen.Click on properties from the available list. Please find below screen shot for your reference. Drag a Listbox on the Userform from the Toolbox.Go To Developer Tab and then click Visual Basic from the Code or Press Alt+F11.Please find the following details how we are changing manually Border Style of listbox property. ListBox Border Style Property:Change Manually Here you can find or see how we are enable or disable Border style of list box manually or using code. It will take you through how to change Border Style property of list box using Excel VBA. Here is the example for ListBox Border Style Property. ListBox Border Style Property – Explanation & Example In the above syntax we are using a ‘BorderStyle’ property of ListBox object to enable or disable border for listbox object. Where ListboxName represents a ListBox object. Please find the below syntax of ListBox Border Style Property using Excel VBA. ListBox Border Style Property: Change Using Code.Output:Case 2: If BorderStyle =1 – frmBorderStyleSingle.Output:Case 1: If BorderStyle =0 – frmBorderStyleNone.

ListBox Border Style Property: Change Manually.ListBox Border Style Property – Explanation & Example.You could also do Drafters and then undo the horizontals, but the code above is sort of a generic bit of code that you could easily adapt to various situations in the future. If, indeed, you don't want to set Inside Horizontal, then something like the following would work.ĭim myBorders() As Variant, item As Variant I noticed that in your example you didn't set the Inside Horizontal. I learned something here - I would not have even tried what Drafter did because I would have guessed that Excel would also have set the Diagonal borders with that syntax.ī.
