HI,
Let’s suppose you have a certain range of cells (let’say A1 :B20) You define “rng” as this range : Set rng = Range(“A1:B10”) « rng.Rows.Count » is the number of rows of rng (10) So : « rng.Rows.Count » - 1 = 9 Now : For r = rng.Rows.Count - 1 To 1 Step -1 Means “for each value of r beginning =with 9 and ending to 1” That is 9, 8, 7, 6, 5, … 1. You generally use “step -1” when you have to delete rows. Regards. Daniel De : excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] De la part de vijayajith VA Envoyé : samedi 30 juillet 2011 16:36 À : excel-macros@googlegroups.com Objet : $$Excel-Macros$$ help Hi, Can anyone brief me below code wat exactly it do with examples? For r = rng.Rows.Count - 1 To 1 Step -1 thanks -- ---------------------------------------------------------------------------- ------ 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 -- ---------------------------------------------------------------------------------- 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