|
-
Feb 6th, 2007, 03:26 PM
#1
Thread Starter
Addicted Member
[2005] Excel- Finding last used cell in a column.
I want to find the last used cell in ANY given column in an Excel spreadsheet. The following code, and variations of it, seem to only report the last used row for the ENTIRE sheet, I don't want that.
VB Code:
lRow = oExcel.Range("A").SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row
I've tried messing with the range value and many other things, I always get the same. I know I can simulate a Ctrl-Up key sequence but that is not reliable (blank in between values). Column A may or may not be longer than B.
To summarize, I want the last used cell (row) in column A, do some things, then get the last used cell (row) in column B and do some things.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|