Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default goto a particular cell

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default goto a particular cell

Try

range("F" & lastusedrow).select


Hilsen Erlen

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default goto a particular cell

should be ok. check the value of lastUsedRow



-----Original Message-----
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


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default goto a particular cell

the value is 241 but it still doesn't work - any other ideas?

"Patrick Molloy" wrote in message
...
should be ok. check the value of lastUsedRow



-----Original Message-----
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


.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default goto a particular cell

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?
"Newbie" wrote in message
...
the value is 241 but it still doesn't work - any other ideas?

"Patrick Molloy" wrote in message
...
should be ok. check the value of lastUsedRow



-----Original Message-----
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


.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default goto a particular cell

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.

--
Regards,
Tom Ogilvy

"Newbie" wrote in message
...
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?
"Newbie" wrote in message
...
the value is 241 but it still doesn't work - any other ideas?

"Patrick Molloy" wrote in message
...
should be ok. check the value of lastUsedRow



-----Original Message-----
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


.







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Goto Cell With Today's Or Other Date jonoro Excel Worksheet Functions 2 December 22nd 09 02:43 AM
find the last Fred and goto cell Steved Excel Worksheet Functions 6 October 11th 07 06:53 PM
Goto a specific cell in a macro Edward Excel Discussion (Misc queries) 0 July 16th 07 08:24 PM
Goto next empty cell in a range Keith Robinson Excel Programming 2 November 15th 03 03:52 AM
on open goto cell with today's date Tom Ogilvy Excel Programming 1 September 14th 03 10:56 PM


All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"