Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default finalrow question

i am using the following bit of code for a macro i am putting together:

Sheets("KPI").Select
Range("A2").Select
FinalRow = Range("A65536").End(xlUp).Row
Range("A2" & FinalRow).Select

at present (varies daily), column a on this sheet has data in cells
a2:a132...when i execute this portion of code, cell A2132 is selected instead
of a2 through the last row. i tried clearing contents and deleting all cells
from a133:iv65536, executed again, and still the same result. what would
cause this problem to occur?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default finalrow question

Try

Sheets("KPI").Select
FinalRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("A2:A" & FinalRow).Select

Mike

"joemeshuggah" wrote:

i am using the following bit of code for a macro i am putting together:

Sheets("KPI").Select
Range("A2").Select
FinalRow = Range("A65536").End(xlUp).Row
Range("A2" & FinalRow).Select

at present (varies daily), column a on this sheet has data in cells
a2:a132...when i execute this portion of code, cell A2132 is selected instead
of a2 through the last row. i tried clearing contents and deleting all cells
from a133:iv65536, executed again, and still the same result. what would
cause this problem to occur?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default finalrow question

Worked perfectly!!! Thank you so much!!!

"Mike H" wrote:

Try

Sheets("KPI").Select
FinalRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("A2:A" & FinalRow).Select

Mike

"joemeshuggah" wrote:

i am using the following bit of code for a macro i am putting together:

Sheets("KPI").Select
Range("A2").Select
FinalRow = Range("A65536").End(xlUp).Row
Range("A2" & FinalRow).Select

at present (varies daily), column a on this sheet has data in cells
a2:a132...when i execute this portion of code, cell A2132 is selected instead
of a2 through the last row. i tried clearing contents and deleting all cells
from a133:iv65536, executed again, and still the same result. what would
cause this problem to occur?

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
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


All times are GMT +1. The time now is 12:34 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"