View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default The last filled cell in a range

Hi Sam

Create a Dynamic named range.
Supposing your data is in cells A1 through M500 at present, and you will be
continually adding new rows.
InsertNameDefineName MyData Refers to =$A$1:INDEX($M:$M,COUNTA($A:$A))

Then your Vlookup formula will become
=VLOOKUP(cell,myData,x,0)
where cell is the cell address for your present lookup value, and x is the
offset that you use at present.

--
Regards
Roger Govier

"The Narcissist" wrote in message
...
Hi Everyone,

I'm working on some HR reports on Excel. The raw employee data is kept in
one sheet and I pull out information from that sheet using VLookup by
looking
up the employee code. However, the employee count keeps changing on a
regular
basis. To make sure that the vlookup function goes through the entire
data, I
have kept all rows till 65536 in the data range. This makes the reports
very
slow. Is there any other way to ensure that the entire data is looked into
without me having to change the range in the vlookup function everytime
there
is an addition or deletion in the raw data? I mean to ask if there is any
function that returns the last filled cell in a range?

Any help would be greatly appreciated.

Thanks,

Sam