+ Reply to Thread
Results 1 to 2 of 2

How do I delete the contents in a cell, every other row?

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    How do I delete the contents in a cell, every other row?

    Say I have numbers going down a column...

    4
    3
    2
    1
    1
    3
    4
    1

    And I want to delete the info in the cell for every other row so it ends up like:
    4

    2

    1

    4

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: How do I delete the contents in a cell, every other row?

    Sub DeleteAlternateRow()
    Dim n, lastRow As Integer
    lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    For n = 2 To lastRow Step 2
    ActiveSheet.Cells(n, 1) = ""
    Next n
    End Sub
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

+ 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