ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   looping to End (https://www.excelbanter.com/excel-programming/292477-looping-end.html)

Nabeel Moeen

looping to End
 
hello all,
when we open a worksheet and press "Ctl-End", the focus shifts to the last
populated cell in the worksheet.

How can this be accomplished programatically, i'd like to traverse all rows
and columns till the end of the file.

Regards,
Nabeel



JE McGimpsey

looping to End
 
one way:

Application.GoTo _
Sheets("Sheet1").Cells.SpecialCells(xlCellTypeLast Cell)

In article ,
"Nabeel Moeen" wrote:

hello all,
when we open a worksheet and press "Ctl-End", the focus shifts to the last
populated cell in the worksheet.

How can this be accomplished programatically, i'd like to traverse all rows
and columns till the end of the file.

Regards,
Nabeel



Jean-Yves[_2_]

looping to End
 
Hi
You may use :

ActiveCell.SpecialCells(xlCellTypeLastCell).Select
or, range("A1").end(xldown).select
use this line in a Sub Workbook_Open in the "ThisWorbook" module.

Regards,

JY

"Nabeel Moeen" wrote in message
...
hello all,
when we open a worksheet and press "Ctl-End", the focus shifts to the last
populated cell in the worksheet.

How can this be accomplished programatically, i'd like to traverse all

rows
and columns till the end of the file.

Regards,
Nabeel






All times are GMT +1. The time now is 11:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com