Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Need some help with a simple Excel Macro  (Read 1131 times)

0 Members and 1 Guest are viewing this topic.


    Topic Starter

    Need some help with a simple Excel Macro
    « on: June 13, 2008, 02:46:19 PM »
    Good morning all,

    I am learning how to write a simple Macro program in Excel:

    A                B                 C
    ===         ===             ===
    Jame        Apple           Apple
    Tom         Orange         Apple
    David       Apple           Apple

    Here is the code:

    Sub testing()
    For N = 1 to 3
    If cells(N,2).value=cells(N,3).value Then
    End IF
    End Sub

    The program will copy specific rows
    when the cells in colum  B equals those in column C,
    and then it will paste the specific rows of data somewhere in the same worksheet.
    The program works but it returns empty cells.
    Here is what the result looks like:
    Empty cell

    Is there any method to skip the empty cells?

    Please kindly help if you could!


    P.S. I am using Excel 2002
    « Last Edit: June 13, 2008, 02:57:33 PM by kwfine »