+ Reply to Thread
Results 1 to 5 of 5

UserForm "run time Error 424 Object Required"

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    211

    UserForm "run time Error 424 Object Required"

    Hi Everyone

    I have created this Basic form but for some reasons when I try to call the form I get error message "run time Error 424 Object Required"

    Can you help please ?

    Thank you

    
    Private Sub UserForm_Click()
    
    End Sub
    
    Private Sub UserForm_Initialize()
    Dim cell As Range
    For Each cell In Range("A2:A5")
    ListBox1.additemcell.Value
    
    Next cell
    
    For Each cell In Range("B2:B5")
    combobox1.additemcell.Value
    Next cell
    
    
    
    
    End Sub
    
    Sub CalculateDDM()
    
    Dim Dividend As Double
    Dim RequiredRtrn As Double
    Dim NumOfYrs As Double
    Dim FinalStockPrice As Double
    Dim sumofPV As Double
    'take user input
    
    Dividend = cell(2, 2).Value
    RequiredRtrn = cell(3, 2).Value
    NumOfYrs = cell(4, 2).Value
    FinalStockPrice = cell(5, 2).Value
    
    'generate Dividend payout and output them to Excel Sheet
    
    rowcounter = 8
    For counter = 1 To NumOfYrs
    Cells(rowcounter, 3).Value = counter
    Cells(rowcounter, 4).Value = Dividend
    Cells(rowcounter, 5).Value = Application.WorksheetFunction.PV(RequiredRtrn, counter, 0, Dividend)
    sumofPV = sumofPV + Cells(rowcounter, 5).Value
    Next counter
    
    'output final caluclated Stock Price
    
    sumofPV = sumofPV + Application.WorksheetFunction.PV(RequiredRtrn, NumOfYrs, 0, -FinalStockPrice)
    Cells(1, 2).Value = sumofPV
    
    MsgBox "DDM Calclulation Complete"
    
    
    
    
    
    End Sub
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: UserForm "run time Error 424 Object Required"

    ListBox1.additemcell.Value
    no listbox in your userform
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    01-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: UserForm "run time Error 424 Object Required"

    Sorry I m a VBA Beginner, but I think I vaguely know what you mean, I guess I have to create a list box with data validation on the worksheet.

    Do you mind giving me step by step how to add the list box to the form ?

    Thanks

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,972

    Re: UserForm "run time Error 424 Object Required"

    No - you need a listbox on the userform since your code is trying to add the data from A2:A5 to a listbox that doesn't exist.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Contributor
    Join Date
    01-03-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: UserForm "run time Error 424 Object Required"

    Thank you guys.

+ 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. [SOLVED] Macro generates the following error: "run-time error 424 object required"
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2014, 06:31 PM
  2. Run-time error "424": Object required
    By TGM™ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-29-2012, 05:57 AM
  3. [SOLVED] "Run-time error '424': Object required" error
    By jaff84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2012, 10:43 AM
  4. [SOLVED] Excel 2007 : Help to Solve Run-time Error 424 "Object Required"
    By D.S.Rama Rao in forum Excel General
    Replies: 6
    Last Post: 03-05-2012, 03:24 PM
  5. "Microsoft Visual Basic runtime error '424' object required".
    By SharonG. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-04-2006, 08:40 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