+ Reply to Thread
Results 1 to 3 of 3

If

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    3

    If

    Hi,

    I am new to vba programming. I am looking to solve this with a macro:

    An excel sheet has this kind of data:

    John Murphy---London---2kg butter---Invoice no. 2111
    John Murphy--London--500g cheese--Invoice no. 2111
    John Murphy--London---2kg tea---Invoice no. 2111
    John Murphy---London---2kg coffee ---Invoice no. 2456
    Jack Doe---New York ---3kg butter--- Invoice no. 2677

    I want to remove the Name and City of the cells following IF the Invoice number is the same. It should lool like (sorry not sure how to show excel columns here):

    John Murphy---London---2kg butter---Invoice no. 2111
    ----500g cheese--Invoice no. 2111
    -----2kg tea---Invoice no. 2111
    John Murphy---London---2kg coffee ---Invoice no. 2456
    Jack Doe---New York ---3kg butter--- Invoice no. 2677

    My knowledge of the IF statement, running down the columns until there are no more rows etc. is limited.

    Thanks.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Help with IF statement

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    06-10-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Help with IF statement

    That was fantastic. Looking at the code, and following the logic was very educational. Thanks.

+ 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