Results 1 to 5 of 5

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

Threaded View

  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


    Private Sub UserForm_Initialize()
        Dim ColCnt As Integer
        Dim rng As Range
        Dim cw As String
        Dim c As Integer
        
        ColCnt = ActiveSheet.UsedRange.Columns.Count
        Set rng = ActiveSheet.UsedRange
        With ListBox1
            .ColumnCount = ColCnt
            .RowSource = rng.Address
            cw = ""
            For c = 1 To .ColumnCount
                cw = cw & rng.Columns(c).Width & ";"
            Next c
            .ColumnWidths = cw
            .ListIndex = 0
        End With
    End Sub
    Attached Images Attached Images
    Last edited by navialivad; 11-18-2014 at 10:12 AM.

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