+ Reply to Thread
Results 1 to 4 of 4

Excel dependent combobox vba programming: Error: Runtimeerror 424: Object required

  1. #1
    Registered User
    Join Date
    09-29-2016
    Location
    Pune
    MS-Off Ver
    2013
    Posts
    2

    Exclamation Excel dependent combobox vba programming: Error: Runtimeerror 424: Object required

    Hello everyone,

    I am new to this VBA programming. I was trying to create one userform using dependet combobox concept. My program is as shown below:

    *********************************************************************************
    Private Sub UserForm_Click()

    End Sub

    Private Sub UserForm_Initialize()
    Dim lastrow As Long
    Dim lastclumn As Long

    With Worksheets("REF")
    lastcolumn = REF.Cells(1, Columns.Count).End(xlToLeft).Column
    For I = 1 To lastcolumn
    With .Column(I)
    lastrow = REF.Cells(Rows.Count, I).End(xlUp).Row
    With Range(Cells(1, I), Cells(lastrow, I))
    Range(Cells(1, I), Cells(lastrow, I)).Select
    Selection.CreateNames Top:=True
    End With
    End With
    Next I
    End With

    Me.ComboBox1.RowSource = "Resource Name"
    End Sub

    *********************************************************************************

    I am getting following error after running this program.

    **********************************************
    ERROR: RUNTIMEERROR 424: OBJECT REQUIRED
    **********************************************

    It will be really helpful if anyone can help me out to resolve this error

  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: Excel dependent combobox vba programming: Error: Runtimeerror 424: Object required

    Where do you get the error?

    PS Can you add code tags when posting code?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-29-2016
    Location
    Pune
    MS-Off Ver
    2013
    Posts
    2
    Quote Originally Posted by Norie View Post
    Where do you get the error?

    PS Can you add code tags when posting code?


    Hello Norie,

    I got this error after adding the following line in the code

    Code:

    lastcolumn = REF.Cells(1, Columns.Count).End(xlToLeft).Column


    Before adding this line the code was properly running .


    N ya I will use code tags form next time ..as I was unaware about it.

  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: Excel dependent combobox vba programming: Error: Runtimeerror 424: Object required

    Try removing REF.

+ 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. ComboBox Value to use in VBA formula gets Run-time error 424 Object Required
    By Bud Wilkinson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-15-2015, 10:34 PM
  2. [SOLVED] Excel vba function asking for object required error 424
    By bilalmussa in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-14-2013, 04:18 PM
  3. [SOLVED] Run time error 424: Object Required in Outlook/Excel VBA
    By sirhacksalot in forum Excel General
    Replies: 9
    Last Post: 12-07-2013, 11:09 AM
  4. [SOLVED] Object Oriented Programming - Help Required
    By mccrimmon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2012, 08:30 AM
  5. Excel VBA Error Code 424 Object Required
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-14-2011, 08:27 AM
  6. RuntimeError 424: Object Required
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2010, 10:55 AM
  7. Combobox | Add items | Object Required
    By gduron in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2006, 10:00 PM

Tags for this Thread

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