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
Re: How to find the last row used in a column ??
What application are you using?
Re: How to find the last row used in a column ??
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
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
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?