+ Reply to Thread
Results 1 to 3 of 3

Run-time error '424': Object requird

  1. #1
    Registered User
    Join Date
    11-26-2013
    Location
    Here
    MS-Off Ver
    Excel 2003
    Posts
    11

    Run-time error '424': Object requird

    Hi all,

    I'm a newby on VBA and have spend many hours writing the following code, but still it doesn't seem to work. Marked in red gives error '424', can anyone help me out with this?

    Option Explicit

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 1 Then Exit Sub
    Application.EnableEvents = False
    Dim LR As Long
    If LCase(Target) = "not approved" Then GoTo notapproved2
    If LCase(Target) = "approved" Then GoTo approved1
    Exit Sub

    notapproved2:
    If LCase(Target) = "not approved" Then
    With Sheets("not approved")
    LR = .Cells(Rows.Count, 1).End(xlUp).Row + 1
    Target.EntireRow.Copy Destination:=.Cells(LR, 1)
    Target.EntireRow.Delete
    End With
    End If
    Application.EnableEvents = True


    approved1:
    If LCase(Target) = "approved" Then
    With Sheets("approved")
    LR = .Cells(Rows.Count, 1).End(xlUp).Row + 1
    Target.EntireRow.Copy Destination:=.Cells(LR, 1)
    Target.EntireRow.Delete
    End With
    End If
    Application.EnableEvents = True

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Run-time error '424': Object requird

    When you delete Target.EntireRow you delete Target, so when the code reaches here Target doesn't exist.
    Please Login or Register  to view this content.
    Try this.
    Please Login or Register  to view this content.
    PS Can you add code tags?
    Last edited by Norie; 12-02-2013 at 08:36 AM.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-26-2013
    Location
    Here
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Run-time error '424': Object requird

    Norie, thank you so very much! It works perfect!

+ 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] 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
  2. [SOLVED] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  3. Replies: 7
    Last Post: 05-15-2013, 09:02 AM
  4. Appropriate Formula requird..
    By uralmi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2013, 03:06 PM
  5. [SOLVED] run-time error '1004': Application-defined or object-deifined error
    By rich5665@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2005, 05:05 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