Hey Eugene,,not easy as you're thinking This code will not give the correct result end -start +1 will never be equal to no of hide rows with filter, because these variable dont know the actual no of hidden rows between the data.
for example see data if i hide 2 and 4, first visible row will be 2 and last visible row will be 6 , total values visible are 3 left(1,3,6) 6-2+1 = 5 Data-A1 1-A2 2-A3 3-A4 4-A5 5-A6 Created this one working effectively on huge amount of data without taking time. :) ActiveSheet.UsedRange.Columns(1).Copy Sheets(2).Range("a1").PasteSpecial lr = Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row Debug.Print Sheets(2).UsedRange.Rows.Count - 1 Regards, MandeepBaluja Learningzmypassion. https://www.facebook.com/VBAEXCELSQL?ref=hl https://www.linkedin.com/profile/view?id=312532939 On Friday, March 20, 2015 at 9:35:43 PM UTC+5:30, Eugene Bernard wrote: > > The below code already given in this group by Mr Asish Kumar.... > > start= ActiveSheet.UsedRange.Offset(1).SpecialCells(xlCellTypeVisible).Row > end= ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row > norows=end-start+1 > > Regards > Eugene > > On Thu, Mar 19, 2015 at 12:56 PM, Mandeep baluja <mandee...@gmail.com > <javascript:>> wrote: > >> >> any other code ?? excep this one >> >> For Each rngarea In .SpecialCells(xlCellTypeVisible).Areas >> lcount = lcount + rngarea.Rows.Count >> Next >> >> -- >> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s >> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >> https://www.facebook.com/discussexcel >> >> FORUM RULES >> >> 1) Use concise, accurate thread titles. Poor thread titles, like Please >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >> will not get quick attention or may not be answered. >> 2) Don't post a question in the thread of another member. >> 3) Don't post questions regarding breaking or bypassing any security >> measure. >> 4) Acknowledge the responses you receive, good or bad. >> 5) Jobs posting is not allowed. >> 6) Sharing copyrighted material and their links is not allowed. >> >> NOTE : Don't ever post confidential data in a workbook. Forum owners and >> members are not responsible for any loss. >> --- >> You received this message because you are subscribed to the Google Groups >> "MS EXCEL AND VBA MACROS" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to excel-macros...@googlegroups.com <javascript:>. >> To post to this group, send email to excel-...@googlegroups.com >> <javascript:>. >> Visit this group at http://groups.google.com/group/excel-macros. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.