Hi Maddy, Your query is quite simple and I wonder if you know VBA, Vlookup and every other thing then where did you stucked up? Since you've provided detailed info in algorithmic format, I've tried to solve your query. If this doesn't suffice you then you need to carefully look into your logic provided to us in FYI tab and here also.
*Solution:* 1. Select the names in PV Sheet. 2. and Run this macro, here is the code by www.excelitems.com: 3. You're Done - Enjoy !!! *Code:* Sub Sort_Valuation_as_per_PV() Dim PVCell As Range Dim Match As Range ' 1. Sheet PV should be activated while running this macro. ' 2. Select B4 to B6 and B11 to B14 and so on as desired before 'running this macro For Each PVCell In Selection.Cells '3. Sheet Valuation should exist Set Match = Sheets("Valuation").Range("A:A").Find (PVCell.Value) '4. If PV data found in Valuation, it will bring up that row If Not Match Is Nothing Then Match.EntireRow.Cut '5. to row 14, can be changed later as you desire. Sheets("Valuation").Rows("10:10").Insert Shift:=xlDown '6. Ask if user wants to update headers or not. If MsgBox("Do you want to update headers?", vbYesNo, _ "Update headers or Not?") = vbYes Then 'Headers matched with PV sheet and updated hence here. Match.Offset(0, 2).Value = PVCell.Offset(0, 5).Value Match.Offset(0, 3).Value = PVCell.Offset(0, 3).Value Match.Offset(0, 4).Value = PVCell.Offset(0, 6).Value Match.Offset(0, 5).Value = PVCell.Offset(0, 4).Value End If End If Next End Sub . . . . . For more tips, tricks, downloads and problem solutions: visit --> http://www.excelitems.com ------------------------------------------------------------------------ Regards *Ashish **Jain* Analyst, CSC Australia Microsoft Certified Application (Excel) Specialist Technical Trainer - Excel and VBA Author -> www.excelitems.com +91-9999-40-48-43 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- On Mar 24, 1:51 pm, Maddy <ma10ku...@gmail.com> wrote: > I request everyone who tries to answer my request, to go through my > attached spreadsheet especially For Your Information Tab COMPLETELY > and CAREFULLY. > > YET NOW NO ONE HAS PROVIDED ME CORRECT SOLUTION. I am wondering > whether anyone correctly understand my issue or not. :( > > On Mar 23, 12:18 pm, Dilip Pandey <dilipan...@gmail.com> wrote: > > > Rightly said Harmeet..!! > > > -- > > DILIP KUMAR PANDEY > > MBA-HR,B COM(Hons.),BCA > > Mobile: +91 9810929744 > > dilipan...@gmail.com > > dilipan...@yahoo.com > > New Delhi - 110062 > > > On Mon, Mar 23, 2009 at 12:42 PM, Harmeet Singh > > <harmeet.hew...@gmail.com>wrote: > > > > Hi Maddy, > > > > Attched file is updated by Sort function. > > > > Trust me for one thing. > > > > Formulas are lot more difficult then VBA , When it comes to these kind of > > > situations. > > > > Let me know if more updation required. > > > > On Sun, Mar 22, 2009 at 8:22 PM, Maddy <ma10ku...@gmail.com> wrote: > > > >> I found no solution for sorting the names in Valuation tab as per PV > > >> tab. ??? > > > >> On Mar 22, 5:45 pm, Harmeet Singh <harmeet.hew...@gmail.com> wrote: > > >> > Hi, > > > >> > Due to time constraint couldn't write VBA macro. > > >> > Sending you updated file, it has formulas and giving required results. > > >> As > > >> > per me for this requirements formulas would be better as compare to > > >> > VBA. > > > >> > Feel free to contact for further clarifications or requirements. > > > >> > On 3/21/09, Mathan Kumar <ma10ku...@gmail.com> wrote: > > > >> > > Sorry... Missed to attach the spreadsheet... Here you go...!!! > > > >> > > Maddy - ma10ku...@gmail.com > > > >> > > On Sun, Mar 22, 2009 at 3:22 AM, Maddy <ma10ku...@gmail.com> wrote: > > > >> > >> Hello Everyone, > > > >> > >> Could anyone write an excel macro to do the below tasks (in Excel > > >> > >> 2003) ? > > > >> > >> I have a "complete" set of names in a sheet named PV. However, the > > >> set > > >> > >> of names are not together and therefore I need to select the range. > > >> > >> Here the data need not be in alphabetical order. > > > >> > >> I have another sheet called "Valuation", where I will be having few > > >> of > > >> > >> the names. Here, too, the starting row of the names can not be > > >> > >> defined. > > > >> > >> Now, I would like to sort the rows in sheet Valuation as per their > > >> > >> order in the earlier sheet PV. If any name is missing in Valuation > > >> > >> sheet, a new row should be inserted and the Name & ID from sheet PV > > >> > >> should be created. > > > >> > >> I have created a sample spreadsheet and included the instructions > > >> too. > > > >> > >> Hope someone will come up with an excellent code. Looking for > > >> > >> that... > > > >> > >> Thanks in advance for your time and efforts. > > > >> > >> Maddy - ma10ku...@gmail.com > > > >> > > -- > > >> > > Best Regards, > > >> > > Mathan Kumar, > > >> > > +91 97107 11780 > > >> > > ma10ku...@yahoo.com > > > >> > -- > > >> > Thanks & Regards, > > > >> > Harmeet Singh > > > >> > Sort_Sample(1).xls > > >> > 74KViewDownload > > > > -- > > > Thanks & Regards, > > > > Harmeet Singh- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---