+ Reply to Thread
Results 1 to 4 of 4

error message macro userform combobox

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    error message macro userform combobox

    Hi,

    I want the user to select a textstring in a combobox that should be displayed in range("I2"). Somehow i get an error message. What am i doing wrong?

    Sub Tekstvak2_Klikken()
    Opvoerder.Show
    End Sub
    Private Sub OpvoerderOptionButton1_Click()
    
    sheet1.Activate
    Cells(2, 9).Value = OpvoerderCombobox.Value
    
    End Sub
    Private Sub OpvoerderOptionButton2_Click()
    Unload Me
    End Sub
    
    Private Sub UserForm_Initialize()
    OpvoerderCombobox.Clear
    With OpvoerderCombobox
        .AddItem "WK"
        .AddItem "MB -D"
        .AddItem "AM"
        .AddItem "AB"
        .AddItem "BK"
        .AddItem "EL"
        .AddItem "AJM"
    End With
    End Sub
    Last edited by MaartenRo; 03-24-2021 at 02:45 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,162

    Re: error message macro userform combobox

    First, Cells(9, 2) is B9, not I2. If you want to refer to I2 use one of these:

    Cells(2, 9)
    Cells(9, "I")
    Range("I2")

    When the error occurs, what line of code is highlighted when you enter Debug? What is the error message?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    Re: error message macro userform combobox

    Thank you for your comment on the cell reference.
    The error occurs at:

    Sub Tekstvak2_Klikken()
    Opvoerder.Show'error message: Error -2147467259 (80007005) runtime error: not specified error (translated from dutch)
    End Sub
    How can i solve this problem?
    Any input is much appreciated!
    Last edited by 6StringJazzer; 03-24-2021 at 08:09 AM.

  4. #4
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    447

    Re: error message macro userform combobox

    Thanks for your reply I solved it by copying the macro's to a new workbook. I guess it has something to do with security of the Excel sheet that i got from someone else.

+ 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. Need help to change ComboBox error message
    By nohero in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2016, 06:39 PM
  2. VBA code error for userform dependent combobox
    By Jonno1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-29-2014, 01:35 PM
  3. [SOLVED] cannot change userform combobox range error 457
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-08-2014, 05:22 PM
  4. Userform returning an error message
    By hstarr2021 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2013, 06:32 PM
  5. Creating and error Message Userform
    By fredlo2010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2013, 11:20 PM
  6. UserForm with Error Message
    By 00Able in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2011, 04:52 AM
  7. Combobox Error Message
    By Olds442 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-20-2007, 04:08 PM
  8. [SOLVED] Custom error-message for MatchRequired ComboBox
    By Gert-Jan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2006, 04:55 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