goto a particular cell

N

Newbie

Hi

I have a variable that holds the row no. I want to make "F"lastused row the
active cell. How can I do this? I have tried:

cells(lastUsedRow,"F").select
but get the error 1004 Select method of Range class failed

and then I tried:

Cells(lastUsedRow, 6).Activate
but get the error 1004 Activate method of Range class failed

Here is the code I have what am I doing wrong?
lastUsedRow = ActiveSheet.UsedRange.Row +
ActiveSheet.UsedRange.Rows.Count -1
Cells(lastUsedRow, 6).Activate
 
N

Newbie

I have just read that some times the Range class doesn't work when the cell
we are trying to activate is empty.
In my case this is true - how can I get round this?
 
T

Tom Ogilvy

Try this code (assumes column A can be used to find the last used row)

cells(rows.count,1).End(xlup).offset(1,5).Select

Make sure you don't have the sheet protected.
 
Top