+ Reply to Thread
Results 1 to 5 of 5

VBA User Form LISTBOX formatting - is it possible - how do I do it?

  1. #1
    Registered User
    Join Date
    02-13-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    47

    Question VBA User Form LISTBOX formatting - is it possible - how do I do it?

    Hello

    Excel User Form

    I have created a UserForm in the VBE environment and very nice it is too.
    It has buttons, frames, text boxes, labels and a LISTBOX.

    This is not on a normal sheet.

    How, or, is it possible to, format a LISTBOX in a User Form?

    I don’t see how I can format the list box apart from font type and size and alignment, (left, centre, right) using the .TextAlign property and this is not selective, it’s all columns or none.

    There are some other things I can change in the property section but not a lot and not what I want to change.

    I can’t (rather don't know how) make some columns centre justified when the remaining columns are left justified.

    I would also like to make one column have word wrap.

    I would like to colour the lines (rows) according to a specific criteria in one column (the word pass or fail) or if that’s not possible then make the lines alternate in a light blue shading to ease readability.

    I can’t even increase the row high.

    Is any of this possible in a user form?

    Are there any “methods” to do this?

    Or is this all too much for userforms?

    Maybe I am googling the wrong things!

    Thank you

    Hattie
    Hattie

    Windows 10 pro 64 Bit
    Office 365 64 Bit

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: VBA User Form LISTBOX formatting - is it possible - how do I do it?

    The listbox formatting is limited.
    Your row height will be determined by your font size.
    It is not possible to change individual row colours, wordwrap is possible by juggling the seperators, but it makes the listbox useless as a selection tool.
    You can left, centre & right justify columns by formatting, however what are you using the listbox for ?
    upload your workbook it is then far easier to give specific advice.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    02-13-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    47

    Re: VBA User Form LISTBOX formatting - is it possible - how do I do it?

    thank you for the reply - limited formatting was what i had expected unfortunatly.

    the spreadsheet is on my computer at work unfortunatly.

    Basically the list box contains row of data about whether a product has passed of failed in testing.

    i just thought i would make the 'passed' rows green and the 'failed' rows red.
    Easy to do in conditional formatting, but the interface doesn't look as nice as a userform.

    and i thought the pass/fail column would look neater if it was centered.

    ah well...

    thanks again

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: VBA User Form LISTBOX formatting - is it possible - how do I do it?

    Something I did in the distant past, the indicator changes color according to the entry in column C.
    A simple alteration to the code to recognise pass/fail would at least give you an indicator.
    Attached Files Attached Files
    Last edited by torachan; 07-20-2021 at 04:42 AM. Reason: missed attaching file

  5. #5
    Registered User
    Join Date
    02-13-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    47

    Re: VBA User Form LISTBOX formatting - is it possible - how do I do it?

    thank you Torachan

    I will look at the code and make the appropriate changes for it to work on my code.

    thank you.

    Hattie

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. User Form with Combox and ListBox
    By roddieeee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2020, 12:22 PM
  2. User Form with Combox and ListBox
    By roddieeee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2020, 04:55 AM
  3. User Form ListBox - Find Records (ListBox Populating Issue)
    By LONeillSSC in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-20-2015, 12:06 PM
  4. [SOLVED] How can I active a row from a listbox in a user form?
    By Magma310 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-07-2013, 03:42 PM
  5. Functional Listbox in User Form
    By warby23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2009, 05:17 AM
  6. populating a listbox on a user form?
    By lrhodes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2006, 07:05 PM
  7. sorting a listbox in a user form
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2006, 09:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1