Hi Jitendra, Not sure how you have arranged the data into your worksheet, but try below code:-
Sub lastRec() i = Range("a65536").End(xlUp).Row MsgBox i-1 'subtract one from i if you have the headers at top End Sub To count non blank cells in a worksheet, you can use COUNTA function. Please get back in case of doubts. Best Regards, DILIPandey On 1/26/11, Jitendra Verma <jitendra.kumarve...@gmail.com> wrote: > Hi,, > > Please tell me how to count the number of total records in a worksheet using > the macro or count of non blank cells in a worksheet. > > -- > *Thanks and Regards,* > Jitendra Kr. Verma| Sr. Software Engineer > Mob: +91.9700695633 > > -- > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- Thanks & Regards, DILIP KUMAR PANDEY, mvp MBA-HR,B.Com(Hons),BCA Mobile: +91 9810929744 dilipan...@gmail.com dilipan...@yahoo.com New Delhi - 62, India -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel