ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Navigate to specific cell on specific worksheet (https://www.excelbanter.com/excel-programming/358823-navigate-specific-cell-specific-worksheet.html)

Bryan

Navigate to specific cell on specific worksheet
 
Hi -

What VBA code tells the cursor to focus on a specific cell in a specific
worksheet.

Basically, I have a macro, and I want the first line to navigate the cursor
to a specific cell before th rest of the macro runs.

Thanks!
Bryan

Edwin Tam[_7_]

Navigate to specific cell on specific worksheet
 
You can use a statement like this:
Activesheet.Range("A1").Select

If the sheet is not yet activated, you can try:
Activeworkbook.worksheets("Sheet1").activate
Activesheet.Range("A1").Select

Regards,
Edwin Tam

http://www.vonixx.com



"Bryan" wrote:

Hi -

What VBA code tells the cursor to focus on a specific cell in a specific
worksheet.

Basically, I have a macro, and I want the first line to navigate the cursor
to a specific cell before th rest of the macro runs.

Thanks!
Bryan


[email protected]

Navigate to specific cell on specific worksheet
 
First, select the sheet in question

Sheets("NameOfSheet").Select

Then, select thge cell in question. There are many ways to do this. The
best method wil depend on your specific situation.

Range("C5").Select 'selects cell c5

or

cells(3,5).Select 'selects cell c5

If you need to select a specific cell but that cells location may not
be known upfront, there are many many other slightly more complicated
but more specific ways of selecting cells.

Joran6



All times are GMT +1. The time now is 05:29 PM.

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