I have about 400 rows of data in an Excel spreadsheet which I've imported from an AS/400. The data is sorted by Column A which contains Operation Numbers. In some cases there may be 5 or 6 rows with the same Operation number.
I want to write some VBA code to delete all the rows which contain duplicate Operation Numbers, leaving only the top one. I had the idea of using a FOR...NEXT loop and an IF statement to cycle through each row in turn, deleting the row if the Operation Number matched that of the row above.
Could someone tell me how I would go about finding which is the last row which contains data so that I can use this figure for my FOR...NEXT loop?
BTW, if I'm going about this the long way round please let me know!!!
I want to write some VBA code to delete all the rows which contain duplicate Operation Numbers, leaving only the top one. I had the idea of using a FOR...NEXT loop and an IF statement to cycle through each row in turn, deleting the row if the Operation Number matched that of the row above.
Could someone tell me how I would go about finding which is the last row which contains data so that I can use this figure for my FOR...NEXT loop?
BTW, if I'm going about this the long way round please let me know!!!