Find last used cell in an column

N

Niklas

Hi
What is the best way of finding the last used cell in a
column?
At the moment i use:

While Len(i_workSheet.Range(i_sColumn & CStr
(i_iIndex)).value) > 0
i_iIndex = i_iIndex + 1
Wend

GetLastUsedRowInColumn = i_iIndex

Yours sincerly
/Niklas
 
W

William

Hi

MsgBox Range("A" & Rows.Count).End(xlUp).Address

or

Range("A" & Rows.Count).End(xlUp).select

--
XL2002
Regards

William
(e-mail address removed)

| Hi
| What is the best way of finding the last used cell in a
| column?
| At the moment i use:
|
| While Len(i_workSheet.Range(i_sColumn & CStr
| (i_iIndex)).value) > 0
| i_iIndex = i_iIndex + 1
| Wend
|
| GetLastUsedRowInColumn = i_iIndex
|
| Yours sincerly
| /Niklas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top