+ Reply to Thread
Results 1 to 13 of 13

Sorting data from a master sheet to multiple sheets depending on values in a given column

  1. #1
    Registered User
    Join Date
    04-30-2013
    Location
    copenhaguen
    MS-Off Ver
    Excel 2010
    Posts
    11

    Sorting data from a master sheet to multiple sheets depending on values in a given column

    Basically, what I want i to sort data from a master sheet to multiple sheets depending on values in a given column of the master sheet. This very same issue has been addressed at http://www.excelforum.com/excel-prog...tml?p=3226790;

    I have been inspired by the codes in the link above, and have made this code:

    Please Login or Register  to view this content.

    how ever, headings (''anlæg'', ''areal'', ...) are not being copied over in all sheets, meaning that the line below is not working correctly:

    Please Login or Register  to view this content.
    Is there anybody that can help me fixing this issue?? This is my very first VBA task,

    Tanks in advance

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    I do not see any syntax error with this line

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-30-2013
    Location
    copenhaguen
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Hello AB33, thanks very much for your answer.

    I have been playing with my sheet since my last post and found out that the very first time I run the code, it will do it correctly (import headings to the respective sheets). How ever, if I update something in my master sheet and run the code again, headings do not import, meaning that the line above does not rerun.

    Else, I have one more issue:

    Is there a way to further develop the program above to sum up column ''areal'' in each sheet, and put the result just under the last data in column ''areal''??

    I have been trying by adding the following line under the (ActiveSheet.Range (''A1:H1''). value....) syntax, but it is not working for some reason:

    Please Login or Register  to view this content.
    In advance, thanks very much for your help.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    kodos10,
    It is difficult to pin point the problem with out seeing the code in your actual data. Could you please attach your sample with the code?

  5. #5
    Registered User
    Join Date
    04-30-2013
    Location
    copenhaguen
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    I have attached my excel file. So, for instance in Sheet 101, I would like for my macro to sum up the numbers in column B and put the result in B14, and so on. Furthermore, I would like for the titles to run the line below in every sheet, also when I rerun the code.

    Please Login or Register  to view this content.
    Once again, thans for your help
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    I have written a new code which I normally use it for this task. Try it
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-30-2013
    Location
    copenhaguen
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Thank you very much AB33, your code works better than the one I had. How ever, it does not calculate the totals of column B in the different sheets. For instance in sheet 101, it should be capable of calculating the total of the numbers in column B and put the result in B14. I had been trying by adding the following syntax in the code I had earlier, but it was not doing it.

    Please Login or Register  to view this content.
    I am not sure where to add in your code, and if it is going to run it it. Do you think you can help with this issue??

    once again, thank you man....

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Do you mean you want to add column B values at the bottom?

  9. #9
    Registered User
    Join Date
    04-30-2013
    Location
    copenhaguen
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Yes, more or less. At the bottom of the last cell containing data in column B.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Try attached
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-30-2013
    Location
    copenhaguen
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Hello AB33, your code works perfectly. You are the best. However, I have been trying to further develop the code to add a summary sheet. The summary sheet should contain the names of the different sheets, and aside of each name, there should be data from the last row (total row). I have been trying with the following code, I found on the net:

    HTML Code: 
    The code is doing what it is supposed to do, however, I does not search through the data and find the relevent data by its own, meaning that for instance, I have to write that it should import data from A29 and B29 and range it in a given cell in the summary sheet. So, if I update my sheet, and my totals move to A30 and B30, it will import the wrong data. I have attached my file as it is now. In sheet summary, you can see how the summary sheet is supposed to look like.

    Once again thanks man, I preciate a lot that you are taking your time to help me
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Kodos,
    Your latest request is not related to the original thread. You should have closed the thread and re-start a new one. Check the attached and if you are happy with the solution provided, please close the thread.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    04-30-2013
    Location
    copenhaguen
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Sorting data from a master sheet to multiple sheets depending on values in a given col

    Hello AB33, Yes I should have closed this tread and started a new one, but you have been so good at helping in this one... Anyway, rules are of course there to be followed, so I will do that next time. Well, your code is working as intended, so thank you very much man.

+ 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