Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default find last row on a worksheet

Ed,

LastRow should be Dim'ed as Integer or Long, not String, as it is a number.

Also, this

LastRow = Range("A" & Rows.Count).End(xlUp).Row

is a little more flexible.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Ed" wrote in message
...
Hi, Tracey. I do it like this:

Dim LastRow As String
LastRow = Range("AD65536").End(xlUp).Row

Then use LastRow any time I need to identify that row (as in Range("D" &
LastRow).Select or
Loop Until ThisRow LastRow.

HTH
Ed

"tracey" wrote in message
...
I'm sure this is easy but I can't seem to figure it out.
How do get a row count on a worksheet? I wrote code that
will delete blank rows but every spreadsheet is different
and the code keeps running to overflow





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
Find tab in worksheet Rodney Excel Discussion (Misc queries) 3 March 9th 10 04:54 AM
how to find and unlink current worksheet from old worksheet kmjmail Excel Discussion (Misc queries) 3 January 12th 09 10:52 PM
Find worksheet LantzK Excel Discussion (Misc queries) 1 May 23rd 08 05:19 PM
Find Max Value in WorkSheet Corey Excel Worksheet Functions 11 January 14th 07 11:00 PM
Find top of worksheet D. McDonough Excel Programming 1 August 18th 03 10:36 PM


All times are GMT +1. The time now is 12:35 PM.

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

About Us

"It's about Microsoft Excel"