+ Reply to Thread
Results 1 to 2 of 2

creating macros in excel

  1. #1
    LisaVan
    Guest

    creating macros in excel

    I need help creating macros in excel. What I am trying to do is create a
    loop (I think) to do the same thing in a column, say every 2 cells. For
    example, I would like to take column C, and delete the contents in every
    other cell. (delete C2, C4, C6, etc. for the entire column).
    Any suggestions would be MOST helpful.
    Thanks.
    Lisa


  2. #2
    Dave Peterson
    Guest

    Re: creating macros in excel

    Maybe something like:

    Option Explicit
    Sub testme()

    Dim iRow As Long
    Dim FirstRow As Long
    Dim LastRow As Long
    With Worksheets("sheet1")
    FirstRow = 2
    LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row
    For iRow = 2 To LastRow Step 2
    .Cells(iRow, "C").ClearContents
    Next iRow
    End With

    End Sub

    Did delete mean clearcontents?

    LisaVan wrote:
    >
    > I need help creating macros in excel. What I am trying to do is create a
    > loop (I think) to do the same thing in a column, say every 2 cells. For
    > example, I would like to take column C, and delete the contents in every
    > other cell. (delete C2, C4, C6, etc. for the entire column).
    > Any suggestions would be MOST helpful.
    > Thanks.
    > Lisa


    --

    Dave Peterson

+ 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