Results 1 to 2 of 2

Object required error 424 solution

Threaded View

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Object required error 424 solution

    Hello everyone
    I found this snippet of code that would summarize duplicates of data in columns A & B
    Public Type product
        name As String
        pages As String
    End Type
    
    Sub GroupProducts()
        Dim produkts() As product
        Dim lastRow, i, j, n As Long
        Dim found As Boolean
        
        ReDim Products(1 To 1)
    
        lastRow = Range("a1").End(xlDown).Row
    
        For i = 2 To lastRow
            found = False
            For j = LBound(Products) To UBound(Products)
                If Cells(i, 1).Value = Products(j).name Then
                    found = True
                    Products(j).pages = Products(j).pages & ", " & Cells(i, 2).Value
                End If
            Next j
    
            If found = False Then
                n = n + 1
                ReDim Preserve Products(1 To n)
                Products(n).name = Cells(i, 1).Value
                Products(n).pages = Cells(i, 2).Value
            End If
    
            Cells(i, 1).Value = ""
            Cells(i, 2).Value = ""
        Next i
    
        For i = LBound(Products) To UBound(Products)
            Cells(i + 1, 1).Value = Products(i).name
            Cells(i + 1, 2).Value = Products(i).pages
        Next i
    End Sub
    I tested it but got an error 424 error (Object Required)
    Can you guide me why it gives the error and how to fix it?
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Object Required - Error 424
    By eSpirit in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-23-2014, 12:39 AM
  2. Error 400 Solution Required
    By Maroota in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-18-2014, 04:37 AM
  3. [SOLVED] Simple Calendar pop up macro --> error Run-time error '424': Object required
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 10:38 AM
  4. Object Required - VBA error
    By Rutger54 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2012, 07:43 PM
  5. Name.Object (Error Object Required)
    By dssrun209 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2010, 01:38 PM
  6. Solution to a #DIV/0 Error required please
    By divingscubaboy in forum Excel General
    Replies: 2
    Last Post: 03-25-2010, 11:59 AM
  7. Error 424 Object Required Error when Using AddItem to ListBox Generated in Code
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 12:47 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