Friday, August 15, 2008

Delete the Last Line of Data

I frequently import a specific data-set of text data into Excel.  After I import the data, I need to delete the last line of data. Following is a cool macro to do this.

    Range("A1").Select ‘Select cell A1
    Selection.End(xlDown).Select ‘Press the END-DOWN keys to move to the last row of data
    Selection.EntireRow.Delete ‘Delete that row

No comments:

Time Math in Excel

You can use the TIME() function to add or subtract hours, minutes or seconds in Excel.  The TIME function takes 3 parameters; HOURS, MINUTES...