+ Reply to Thread
Results 1 to 4 of 4

Delete rows with a number in column A

  1. #1
    Registered User
    Join Date
    12-23-2005
    Posts
    12

    Question Delete rows with a number in column A

    How do I delete only the rows that have a number in column A?

  2. #2
    Forum Contributor
    Join Date
    11-11-2005
    Posts
    267
    try:

    Sub m()
    Dim i As Long

    For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
    If IsNumeric(Cells(i, "a")) Then
    c.EntireRow.Delete '===> deletes entirerow
    'Cells(i, "a").Delete shift:=xlUp '====> deletes only cells in column A
    End If
    Next

    End Sub

  3. #3
    Registered User
    Join Date
    12-23-2005
    Posts
    12
    Thanks, but I am getting the runtime error 424: object required?

  4. #4
    Forum Contributor
    Join Date
    11-11-2005
    Posts
    267
    Which line returns the error? Works fine for me.

    Myles

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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