Question : Excel  - Delete all rows below the last row of data

I have an existing Excel macro. I need code to add to it that will delete all rows below the last row containing data. If you need to know what columns I am using, data can appear in any column from A through W.

Answer : Excel  - Delete all rows below the last row of data

xlUp is just a comment for the equivalent constant, you can use it instead of -4162.

I mentioned in the previous question, that the error might be due to you not defining xlWs, which is just a placeholder for the worksheet you're doing this on. You can replace xlWs with Sheet1 or Activesheet or Worksheets("YourSheetName Here"), etc.
Random Solutions  
 
programming4us programming4us