+ Reply to Thread
Results 1 to 18 of 18

Macro to code the Data set in another sheet to append in columns based on Criteria

  1. #1
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Exclamation Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    I am having a work book with Rep & Manager that to be appended to Data sheet based on criteria.

    Append data set from the sheet "Rep & Manager" for "Category A" (Column B) based on H8 value.
    No Matter the rep count should be same or not.
    Similarly as for B & C Category based on H9 & H10 cell values. Values in column H may change on daily basis.

    Here with attached an example workbook what exactly need.
    Book1.xlsx

    Please could any one help me with Code..
    Thanks & Regards
    Chaitanya A

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    anchuri_chaitanya,

    Could you provide a better description as to what you want?
    If you could show a "Before" and "After".
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  3. #3
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi Charles,

    Thanks for the quick response..
    Please find the workbook as before and after sheets for better understanding..

    Book1(1).xlsx

  4. #4
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    So we can assume if there is a value in column H for category "A" columns C and D needs to be populate for the category of "A"?
    So now the question is when you look at the "Rep&Management" sheet. How do you know copy there and have it populate the category in the Before sheet?
    Also to let you know I will be gone for the rest of today. However another member may pick up on this. If not I'll send something tomorrow.

  5. #5
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi Charles,

    I do sort on the Category column and do copy the data set from Rep&Manger sheet, paste in C & D columns, will drag down till the count of column H value. and then for category B and C. doing manually every time is a big task, causes more manual work. And more the number in column H will not be same, it will high in a day and may be less for another day.

    Thanks for your time, sure will wait for the great help from your end and / or from the team.

    Have peaceful rest for the day..

  6. #6
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    How do you determine for category "A" which Rep/Manager to use? I see no correlation between the two.
    When I look at the Rep/Manager sheet I do not see anything there to say for Cat "A" you would use "ABC POT".

  7. #7
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi Charles,

    Here comes with only the data set to append to the categories A/B/C. All the REP / Manager in the REP & Manager sheet should be appended to all the three Categories based on the column H values. There is no specific Rep - Manager to be appended to Category A/B/C. It is all about the count based on the column H that data set to be appended.

    If not clear, please let me know, Charles.

  8. #8
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    Even though there are values in column H, I still do not see how you determine which "Rep/Mgr" goes to Cat "A".
    There is nothing in the "Rep/Mgr" tells me what to copy to the desired location.
    How do I know if the value "150" is for Cat "A" or B or C?

  9. #9
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi Charles,

    All the "Rep/Mgr" for Cat "A", "B" and "B" would be same. There is no differentiation of Rep/Mgr for Cat A/B/C. Rep/Mgr as a Data set that to be appended to the Category based on Column H value. If you go through the "After" worksheet filter on Rep/Mgr then for Cat A count of Rep/Mgr will be 150 and so on for B/C according to the value in H column which in Before sheet. This is all about the repetition of the data set that many times.

    appedn data to repeated values with a fixed array to be repeated on value change.xls
    The attached is the workbook previously helped by one of the Team Member.
    Like this the data set to be repeated, but here based on the value in column H.

  10. #10
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    Take a look at the attachment.
    If the data for each Cat should equal the values in column H.
    Then I assume it would be the same sequence as in the Rep/Mgr sheet.
    You will see that this does not hold true as displayed in this copy.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi Charles,

    Exactly 1 & 2 of your points. Also the last "You will see that this does not hold true as displayed in this copy".

    The count of Rep/Mgr may not be same for all the records. Here the value in column H, those many time that data should reflect. May be for few reps the records won't be same.

  12. #12
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    Will have to look at the tomorrow. Am leaving soon.

  13. #13
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    Another question. In your example for the "After" sheet you have for example: Cat "A" with more that 150 rows.
    Will this always be the case?

  14. #14
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi Charles,

    Yes, exactly there will be more rows for Cat "A/B/C" than the count(value) in the column H.

  15. #15
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    Sorry for the delay.
    See if this is what you want.It can be modified.
    You will see a button. When you click it the data you want will be refreshed and copied back to the sheet.
    Attached Files Attached Files

  16. #16
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    Did you check the latest file???

  17. #17
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi Charles,

    I am sorry for the delay in the feedback. Just now I gone through yours attachment.

    Wow..!! its working great. You are simply cool..

    Thanks a lot for the code and your precious time.
    In case if any modifications needed, may I come back to the same and can post?

  18. #18
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Macro to code the Data set in another sheet to append in columns based on Criteria

    Hi,

    Thanks for letting us know it works. If your satisfied then please show the thread "Solved".
    If you require further help you can start a new thread.
    Also be sure you click the "Star" below their name.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1