Run this in Claims Paid File Sub DoSomething() Dim rng As Range Dim cell As Range Dim rng2 As Range Dim cell2 As Range Dim i As Integer i = 1 Set rng = Range("A:A") rng.Sort Key1:=Range("A2") rng.Copy Range("D1") Range("D:D").RemoveDuplicates 1 Set rng2 = Range("D2:D" & Range("D65536").End(xlUp).Row) For Each cell2 In rng2 For Each cell In rng If cell.Value = cell2.Value Then cell2.Offset(0, i).Value = cell.Offset(0, 1).Value i = i + 1 End If Next i = 1 Next End Sub
-----Original Message----- From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of KAUSHIK SAVLA Sent: Thursday, July 28, 2011 3:50 PM To: excel-macros@googlegroups.com Subject: Fwd: $$Excel-Macros$$ Vba Code required ---------- Forwarded message ---------- From: KAUSHIK SAVLA <savla.kaus...@gmail.com> Date: Thu, 28 Jul 2011 11:40:35 +1000 Subject: $$Excel-Macros$$ Vba Code required To: excel-macros@googlegroups.com Hi All, Vba code required for doing the below activity: I am having excel data as arrached (Claims Paid). There are many claims one below another as you will be able to see it in Column A, with amount paid in the next column. These claim no. are repeating one below another.I want a Vba Code to do the below activity: A. Sort the whole given data on basis of Claims ie Column A B. Then i want the data to be transposed relating to each claim no. on seperate line one below another (Final Reequired Output file:- Claims Paid Sequence as attached). Please help on it. -- ---------------------------------------------------------------------------- ------ 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 -- Sent from Gmail for mobile | mobile.google.com Kaushik Savla -- ---------------------------------------------------------------------------- ------ 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