Consulting

Results 1 to 9 of 9

Thread: Paste value from combobox into cell

  1. #1

    Paste value from combobox into cell

    This might be incredibly simple, but i cannot figure it out right.

    i have a combobox "comboXX" which has a value which i wanna print in a cell "A1".

    is there a easy way to do this....


    appreciate it!

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    [VBA] Range("A1").Value = cboResponsible1.Value[/VBA]

    If it's an activeX combobox......you don't say.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    hmmm
    This is exactly what i tried

    [VBA]Sub registrer()

    Sheets("Data").Range("a1").Value = Combobox.Value


    End Sub[/VBA]

    combobox is a dropdown list from where i choose a value - does anybody have a clue of what i'm doing wrong??

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    is combobox the actual name of the combobox?

    after seeing your post at 3 I'm not sure what we are working with here.

    Is there just no possible way for you to post the example that is not working?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    sure ill post it. In this book its called comraadgiver ... and i wanna paste the chosen value from that combobox to A1 in the sheet called "base"

  6. #6
    its the sub called "registrer" in the module1

  7. #7
    I have tried to run the code without the combobox ...
    This works - so im guessing that the error must stem from the right hand side.
    [VBA]
    Sub registrer()

    Sheets("Data").Range("a1").Value = Combobox.Value


    End Sub
    [/VBA]

    i have also tried the following...
    [VBA]
    Sub registrer()

    Sheets("Data").Range("a1").Value = Combobox.text


    End Sub
    [/VBA]

    this doesnt work either ...

  8. #8
    Is it a problem that the combobox is in the excel sheet

  9. #9
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    [vba]Sheets("base").Range("a1").Value = Sheets("Startside").Comraadgiver.Value[/vba]

Posting Permissions

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