Hi ashish sir, thanks for your time and solution,but in my excel database column no is diff ,can u pls provide me the same macro code based on below column no as per my database
header - column no. Name - 4 process doj -63 process - 61 ref type -87 process doj 1 -92 process1 -90 ref type 1-116 process doj 2-123 process 2 - 121 ref type 2 -147 process doj 3-154 process 3- 152 ref type 3-178 final status-236 sorry for details are not property mention as sending from mobile. On 2/2/11, ashish koul <koul.ash...@gmail.com> wrote: > see if it helps > > Sub add_data() > Application.ScreenUpdating = False > Application.DisplayAlerts = False > Dim i, j, k, s As Long > s = 2 > Sheets(2).Range("a2:d" & Sheets(2).Range("a1").End(xlDown).Row).Clear > For i = 2 To Sheets(1).Range("A2").End(xlDown).Row > For j = 2 To Sheets(1).Range("A1").End(xlToRight).Column > If UCase(Application.WorksheetFunction.Trim(Left(Sheets(1).Cells(1, > j).Value, 11))) = UCase("Process DOJ") Then > > Sheets(2).Cells(s, 1).Value = Sheets(1).Cells(i, 1).Value > Sheets(2).Cells(s, 2).Value = Sheets(1).Cells(i, j).Value > Sheets(2).Cells(s, 3).Value = Sheets(1).Cells(i, j + 1).Value > Sheets(2).Cells(s, 4).Value = Sheets(1).Cells(i, j + 2).Value > > If UCase(Application.WorksheetFunction.Trim(Sheets(1).Cells(1, j + > 3).Value)) = UCase("Final Status") Then > Sheets(2).Cells(s, 4).Value = Sheets(1).Cells(i, j + 3).Value > End If > > s = s + 1 > End If > Next j > s = s + 1 > Next i > Application.ScreenUpdating = True > Application.DisplayAlerts = True > End Sub > > > > On Tue, Feb 1, 2011 at 10:20 AM, maulik desai <mauliksde...@gmail.com>wrote: > >> >> Hi Guru, >> >> Kindly Provide the solution for attached file >> >> My problem is: >> >> I am having 2 workbook , in 1st Excel Workbook (Database) I m having data >> with multipul Process name ,doj & their respective ref type >> what I want that in 2nd excel sheet (working File) I am having diff format >> (mention above) ,with individual Entries as per process name & process DOJ >> Kindly proive me the solution that how can I get the Ref type as per >> process doj & Process name >> Kindly note that some time the process name & process doj is same but >> their >> ref type is diff so in that case I want the last or latest entry's ref >> type >> as out put as mention in above case (mention in yellow) >> >> -- >> Thanks & Regards, >> Maulik Desai >> 9967363926 >> >> -- >> >> ---------------------------------------------------------------------------------- >> 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 >> > > > > -- > *Regards* > * * > *Ashish Koul* > *akoul*.*blogspot*.com <http://akoul.blogspot.com/> > *akoul*.wordpress.com <http://akoul.wordpress.com/> > My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> > > > P Before printing, think about the environment. > > -- > ---------------------------------------------------------------------------------- > 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 my mobile device Thanks & Regards, Maulik Desai 9967363926 -- ---------------------------------------------------------------------------------- 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