+ Reply to Thread
Results 1 to 8 of 8

Thread: Getting the columnmeads

  1. #1
    alvin Kuiper
    Guest

    Getting the columnmeads

    Hi
    I use this to make the values in a combobox
    Dim myrange1 As Range

    Set myrange1 = Sheets("ark1").Range("navne")
    For Each a In myrange1
    kurtype.AddItem a.Text
    Next

    The range("navn") is a namerange there taking all the values in row 1
    In my combo box i want to see the values i have this is what i also have
    today
    but when i choose one value in my combobox i want to get the columnname as a
    value in a variable or something like that

    Hope someone understand

    Regards
    Alvin


  2. #2
    Dave Peterson
    Guest

    Re: Getting the columnmeads

    Maybe this'll give you an idea:

    Option Explicit
    Private Sub CommandButton1_Click()
    Unload Me
    End Sub
    Private Sub CommandButton2_Click()
    Dim myRange1 As Range
    Set myRange1 = Sheets("ark1").Range("navne")
    With kurtype
    If .ListIndex < 0 Then
    'nothing selected
    Else
    MsgBox .ListIndex & "--" & .Value & _
    vbLf & myRange1.Cells(1).Offset(0, .ListIndex).Column
    End If
    End With
    End Sub
    Private Sub UserForm_Initialize()
    Dim myRange1 As Range
    Dim a As Range
    Set myRange1 = Sheets("ark1").Range("navne")
    For Each a In myRange1
    kurtype.AddItem a.Text
    Next
    End Sub


    alvin Kuiper wrote:
    >
    > Hi
    > I use this to make the values in a combobox
    > Dim myrange1 As Range
    >
    > Set myrange1 = Sheets("ark1").Range("navne")
    > For Each a In myrange1
    > kurtype.AddItem a.Text
    > Next
    >
    > The range("navn") is a namerange there taking all the values in row 1
    > In my combo box i want to see the values i have this is what i also have
    > today
    > but when i choose one value in my combobox i want to get the columnname as a
    > value in a variable or something like that
    >
    > Hope someone understand
    >
    > Regards
    > Alvin


    --

    Dave Peterson

  3. #3
    Ron de Bruin
    Guest

    Re: Getting the columnmeads

    Hi Alvin

    I am not sure that I understand you ?
    You can use kurtype.Value in your other code to use the value of the selected item in the combobox

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message news:341592AC-BB15-4636-9584-59334977A511@microsoft.com...
    > Hi
    > I use this to make the values in a combobox
    > Dim myrange1 As Range
    >
    > Set myrange1 = Sheets("ark1").Range("navne")
    > For Each a In myrange1
    > kurtype.AddItem a.Text
    > Next
    >
    > The range("navn") is a namerange there taking all the values in row 1
    > In my combo box i want to see the values i have this is what i also have
    > today
    > but when i choose one value in my combobox i want to get the columnname as a
    > value in a variable or something like that
    >
    > Hope someone understand
    >
    > Regards
    > Alvin
    >




  4. #4
    alvin Kuiper
    Guest

    Re: Getting the columnmeads

    Hej dave
    MAybe i don't explain so good
    What i want is the value of where the selected value are
    Like is it in column A , b, h , q And so on

    Regards
    alvin


    "Dave Peterson" wrote:

    > Maybe this'll give you an idea:
    >
    > Option Explicit
    > Private Sub CommandButton1_Click()
    > Unload Me
    > End Sub
    > Private Sub CommandButton2_Click()
    > Dim myRange1 As Range
    > Set myRange1 = Sheets("ark1").Range("navne")
    > With kurtype
    > If .ListIndex < 0 Then
    > 'nothing selected
    > Else
    > MsgBox .ListIndex & "--" & .Value & _
    > vbLf & myRange1.Cells(1).Offset(0, .ListIndex).Column
    > End If
    > End With
    > End Sub
    > Private Sub UserForm_Initialize()
    > Dim myRange1 As Range
    > Dim a As Range
    > Set myRange1 = Sheets("ark1").Range("navne")
    > For Each a In myRange1
    > kurtype.AddItem a.Text
    > Next
    > End Sub
    >
    >
    > alvin Kuiper wrote:
    > >
    > > Hi
    > > I use this to make the values in a combobox
    > > Dim myrange1 As Range
    > >
    > > Set myrange1 = Sheets("ark1").Range("navne")
    > > For Each a In myrange1
    > > kurtype.AddItem a.Text
    > > Next
    > >
    > > The range("navn") is a namerange there taking all the values in row 1
    > > In my combo box i want to see the values i have this is what i also have
    > > today
    > > but when i choose one value in my combobox i want to get the columnname as a
    > > value in a variable or something like that
    > >
    > > Hope someone understand
    > >
    > > Regards
    > > Alvin

    >
    > --
    >
    > Dave Peterson
    >


  5. #5
    alvin Kuiper
    Guest

    Re: Getting the columnmeads

    Hi ron
    MAybe i'm not xpalin me so good
    My value in my combobox come from a row
    and mybe from A to Q
    What i want is when a choose a value in my combobox
    maybe "Teskt1" then i want to see where tekst1 are in the sheet
    is it in column A Or column G or .......... And so on

    regards

    Alvin


    "Ron de Bruin" wrote:

    > Hi Alvin
    >
    > I am not sure that I understand you ?
    > You can use kurtype.Value in your other code to use the value of the selected item in the combobox
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message news:341592AC-BB15-4636-9584-59334977A511@microsoft.com...
    > > Hi
    > > I use this to make the values in a combobox
    > > Dim myrange1 As Range
    > >
    > > Set myrange1 = Sheets("ark1").Range("navne")
    > > For Each a In myrange1
    > > kurtype.AddItem a.Text
    > > Next
    > >
    > > The range("navn") is a namerange there taking all the values in row 1
    > > In my combo box i want to see the values i have this is what i also have
    > > today
    > > but when i choose one value in my combobox i want to get the columnname as a
    > > value in a variable or something like that
    > >
    > > Hope someone understand
    > >
    > > Regards
    > > Alvin
    > >

    >
    >
    >


  6. #6
    Ron de Bruin
    Guest

    Re: Getting the columnmeads

    You can use the index from the combobox

    Try this

    MsgBox Cells(1, Me.kurtype.Value + 1).Address


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message news:FC6854BC-7C07-405D-916F-0CF4DBCFD3B5@microsoft.com...
    > Hi ron
    > MAybe i'm not xpalin me so good
    > My value in my combobox come from a row
    > and mybe from A to Q
    > What i want is when a choose a value in my combobox
    > maybe "Teskt1" then i want to see where tekst1 are in the sheet
    > is it in column A Or column G or .......... And so on
    >
    > regards
    >
    > Alvin
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi Alvin
    >>
    >> I am not sure that I understand you ?
    >> You can use kurtype.Value in your other code to use the value of the selected item in the combobox
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message
    >> news:341592AC-BB15-4636-9584-59334977A511@microsoft.com...
    >> > Hi
    >> > I use this to make the values in a combobox
    >> > Dim myrange1 As Range
    >> >
    >> > Set myrange1 = Sheets("ark1").Range("navne")
    >> > For Each a In myrange1
    >> > kurtype.AddItem a.Text
    >> > Next
    >> >
    >> > The range("navn") is a namerange there taking all the values in row 1
    >> > In my combo box i want to see the values i have this is what i also have
    >> > today
    >> > but when i choose one value in my combobox i want to get the columnname as a
    >> > value in a variable or something like that
    >> >
    >> > Hope someone understand
    >> >
    >> > Regards
    >> > Alvin
    >> >

    >>
    >>
    >>




  7. #7
    Ron de Bruin
    Guest

    Re: Getting the columnmeads

    Oops Typo

    Use Me.kurtype.ListIndex



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:uwNfSywLGHA.1312@TK2MSFTNGP09.phx.gbl...
    > You can use the index from the combobox
    >
    > Try this
    >
    > MsgBox Cells(1, Me.kurtype.Value + 1).Address
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message news:FC6854BC-7C07-405D-916F-0CF4DBCFD3B5@microsoft.com...
    >> Hi ron
    >> MAybe i'm not xpalin me so good
    >> My value in my combobox come from a row
    >> and mybe from A to Q
    >> What i want is when a choose a value in my combobox
    >> maybe "Teskt1" then i want to see where tekst1 are in the sheet
    >> is it in column A Or column G or .......... And so on
    >>
    >> regards
    >>
    >> Alvin
    >>
    >>
    >> "Ron de Bruin" wrote:
    >>
    >>> Hi Alvin
    >>>
    >>> I am not sure that I understand you ?
    >>> You can use kurtype.Value in your other code to use the value of the selected item in the combobox
    >>>
    >>> --
    >>> Regards Ron de Bruin
    >>> http://www.rondebruin.nl
    >>>
    >>>
    >>> "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message
    >>> news:341592AC-BB15-4636-9584-59334977A511@microsoft.com...
    >>> > Hi
    >>> > I use this to make the values in a combobox
    >>> > Dim myrange1 As Range
    >>> >
    >>> > Set myrange1 = Sheets("ark1").Range("navne")
    >>> > For Each a In myrange1
    >>> > kurtype.AddItem a.Text
    >>> > Next
    >>> >
    >>> > The range("navn") is a namerange there taking all the values in row 1
    >>> > In my combo box i want to see the values i have this is what i also have
    >>> > today
    >>> > but when i choose one value in my combobox i want to get the columnname as a
    >>> > value in a variable or something like that
    >>> >
    >>> > Hope someone understand
    >>> >
    >>> > Regards
    >>> > Alvin
    >>> >
    >>>
    >>>
    >>>

    >
    >




  8. #8
    alvin Kuiper
    Guest

    Re: Getting the columnmeads

    yes yes yes
    Thanks Ron

    regards
    alvin


    "Ron de Bruin" wrote:

    > Oops Typo
    >
    > Use Me.kurtype.ListIndex
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:uwNfSywLGHA.1312@TK2MSFTNGP09.phx.gbl...
    > > You can use the index from the combobox
    > >
    > > Try this
    > >
    > > MsgBox Cells(1, Me.kurtype.Value + 1).Address
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > > "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message news:FC6854BC-7C07-405D-916F-0CF4DBCFD3B5@microsoft.com...
    > >> Hi ron
    > >> MAybe i'm not xpalin me so good
    > >> My value in my combobox come from a row
    > >> and mybe from A to Q
    > >> What i want is when a choose a value in my combobox
    > >> maybe "Teskt1" then i want to see where tekst1 are in the sheet
    > >> is it in column A Or column G or .......... And so on
    > >>
    > >> regards
    > >>
    > >> Alvin
    > >>
    > >>
    > >> "Ron de Bruin" wrote:
    > >>
    > >>> Hi Alvin
    > >>>
    > >>> I am not sure that I understand you ?
    > >>> You can use kurtype.Value in your other code to use the value of the selected item in the combobox
    > >>>
    > >>> --
    > >>> Regards Ron de Bruin
    > >>> http://www.rondebruin.nl
    > >>>
    > >>>
    > >>> "alvin Kuiper" <alvinKuiper@discussions.microsoft.com> wrote in message
    > >>> news:341592AC-BB15-4636-9584-59334977A511@microsoft.com...
    > >>> > Hi
    > >>> > I use this to make the values in a combobox
    > >>> > Dim myrange1 As Range
    > >>> >
    > >>> > Set myrange1 = Sheets("ark1").Range("navne")
    > >>> > For Each a In myrange1
    > >>> > kurtype.AddItem a.Text
    > >>> > Next
    > >>> >
    > >>> > The range("navn") is a namerange there taking all the values in row 1
    > >>> > In my combo box i want to see the values i have this is what i also have
    > >>> > today
    > >>> > but when i choose one value in my combobox i want to get the columnname as a
    > >>> > value in a variable or something like that
    > >>> >
    > >>> > Hope someone understand
    > >>> >
    > >>> > Regards
    > >>> > Alvin
    > >>> >
    > >>>
    > >>>
    > >>>

    > >
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0