Microsoft Excel Question:
Download Questions PDF

Is there a way to determine the last active column in a spreadsheet?

Answer:

In a macro, you can use:
LastCol = ActiveCell.SpecialCells(xlLastCell).Column
If you have a rectangular section of data which you know starts in Row 1, then you can use this to find the last column:
LastColumn = Range("IV1").End(xlLeft).Column
Use this to find the last row:
LastRow = Range("A65000").End(xlUp).Row

Download MS Excel Interview Questions And Answers PDF

Previous QuestionNext Question
I have a column of numbers in the format 99999-99999. What is a simple macro to remove the dash?My furnace and air conditioner are both new. Do I really need to have it cleaned?