|
-
Apr 24th, 2007, 02:23 AM
#1
Thread Starter
Member
How to find the last row used in a column ??
Hey guys!
How can i find out the last used row number (last row with a string in it)
in a particular column.
I have to search for strings one by one in columns and perform certain actions on them but i first need to find out how many strings there are so that i can make an appropriate loop.
Please advise
cheers
Abhilash
-
Apr 24th, 2007, 02:34 AM
#2
Re: How to find the last row used in a column ??
What application are you using?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 24th, 2007, 02:44 AM
#3
Thread Starter
Member
Re: How to find the last row used in a column ??
-
Apr 24th, 2007, 03:08 AM
#4
Re: How to find the last row used in a column ??
Since there isn't really columns n rows in vb.2005, what are you using it with... access or excel?
I know a bit of VBA but not much of .net. I may be able to point you in the right direction tho
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 25th, 2007, 12:22 AM
#5
Thread Starter
Member
Re: How to find the last row used in a column ??
I am using Excel.. sorry i forgot to mention that earlier.. I am guessing VBA cud help me..
cheers
Abhilash
-
Apr 25th, 2007, 02:05 AM
#6
Re: How to find the last row used in a column ??
There is a property in Excel vba to get the bottom most cell used. however sometimes it thinks its used and its not 
So I'd recommend the following:
Make sure you have a column that is guarenteed to have data.
from the lowest cell in that column do the end+up combo.
You should now be on the lowest row of data.
You can record this action in a macro to see how it works. Should be something like:
Code:
msgbox "Bottom Row : " & sht.cells(65000,1).end(xlup).row
From in excel. The sht is the worksheet, xlup is a constant, you can get this from the immediates windo in excel vba.
You can also come from above, but if you only have a title row it is not helpful.
Does that help?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
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
|