Microsoft Excel Question:
Download Job Interview Questions and Answers 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
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