+ Reply to Thread
Results 1 to 5 of 5

User-Form Problem: User can select headers in User Form (I want Header/no way to select)

  1. #1
    Registered User
    Join Date
    07-24-2014
    Location
    Phoenix
    MS-Off Ver
    2007
    Posts
    21

    User-Form Problem: User can select headers in User Form (I want Header/no way to select)

    Greetings everybody

    So I have the following code as part of a userform I modified slightly from a Book (Excel 2010: Power Programming with VBA). I cant seem to see the attached image but what I get is the headers with a selection box next to it, what I want is for the first row to not be selectable. I need the headers but I don't want the user to be able to select them. I already programmed around this, since the macro ignores this selection but it looks unfinished with this issue. Will appreciate any and all support.

    I know this could probably be explained better but I can't find an easy way to explain


    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by navialivad; 11-18-2014 at 10:12 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: User-Form Problem: User can select headers in User Form (I want Header/no way to selec

    Have you set ColumnHeaders to true for the listbox?

    What range are you using to populate the listbox and which row are the headers in?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-24-2014
    Location
    Phoenix
    MS-Off Ver
    2007
    Posts
    21

    Re: User-Form Problem: User can select headers in User Form (I want Header/no way to selec

    Hi Norie

    Sorry for my ignorance, very new with userforms, I don't know how to check your first question. Would that be to simply add something like ".Columnheaders = true"?

    Headers are in row 1

    The range's rows are dynamic, the columns are A through H. The way its programmed it takes everything on the sheet:
    Please Login or Register  to view this content.
    Thanks for the help
    Last edited by navialivad; 11-18-2014 at 10:06 AM.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: User-Form Problem: User can select headers in User Form (I want Header/no way to selec

    You could set ColumnHeaders at design or run time.

    As for the range, does it actually include row 1?

  5. #5
    Registered User
    Join Date
    07-24-2014
    Location
    Phoenix
    MS-Off Ver
    2007
    Posts
    21

    Re: User-Form Problem: User can select headers in User Form (I want Header/no way to selec

    Norie, THANKS!!!!!

    Your questions kind of guided me to what I needed. I modified the code shown in my initial post to the following, as you can see the "set range" is now ignoring the first row and I added the "Columnheads=true" statement:

    Please Login or Register  to view this content.
    I didn't know about the header option until you asked me about it and then found that you need to leave the headers outside of the range. :D
    Thanks!!!

+ 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. Replies: 1
    Last Post: 08-12-2014, 03:05 AM
  2. Select range for a Ref in the user form.
    By kiki13140702 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2014, 07:22 PM
  3. [SOLVED] Select 1st item in a List box in a User form?
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2013, 11:23 AM
  4. User Form and Select Case Help
    By yusunghee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-17-2011, 01:22 PM
  5. User Form to select other User Forms
    By nms2130 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2011, 12:57 PM

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