+ Reply to Thread
Results 1 to 7 of 7

create sheets based on cell values with corresponding data

  1. #1
    Registered User
    Join Date
    08-27-2015
    Location
    Mumbai, India
    MS-Off Ver
    MS Office 2007
    Posts
    8

    create sheets based on cell values with corresponding data

    Hi,
    Need help with a macro.
    I have a sheet with the below data

    Sr.No Name Days Grp Status
    1 abc 1234 1 no
    1 abc 1234 1 no
    1 abc 1234 1 no
    2 abc 1234 1 no
    2 abc 1234 1 no
    2 abc 1234 1 no
    2 abc 1234 1 no
    3 abc 1234 1 no
    3 abc 1234 1 no
    3 abc 1234 1 no
    4 abc 1234 1 no
    4 abc 1234 1 no
    5 abc 1234 1 no
    5 abc 1234 1 no

    I need to create sheets based on the Sr. No. Column and the corresponding data to be copied on to the respective sheets.
    For. Eg: create sheet with name 1 and copy all the data related to 1 in that sheet and a sub total for column Days. which means sheet with name 1 should contain all the three rows of sr. no.1 and total for column days which will be 3702.

    Subsequently create sheets for the other numbers upto 5.

    Request your help on this.

    Thanks in advance.

    Regards,
    Vinod

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: create sheets based on cell values with corresponding data

    The sheet containing data should be named "Data".
    Use this macro-
    Please Login or Register  to view this content.
    Check attached for reference.
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Registered User
    Join Date
    08-27-2015
    Location
    Mumbai, India
    MS-Off Ver
    MS Office 2007
    Posts
    8

    Re: create sheets based on cell values with corresponding data

    Hi Sourabh,

    Thank you so much with this. I have another data which is in a different sequence. I am trying to use the similar logic but am not able to work out. Can you please help.

    I have attached the data.
    Site Pay Code Date and Time Dash To Time Pay Level Hours Type Rate Hours (Time)
    6197 7435 01/01/2016 15:00 - 23:00: Guard Level 2 Bank Holiday 13.40 8.00
    6197 7435 02/01/2016 07:00 - 15:00: Guard Level 2 Regular 6.70 8.00
    6197 7435 03/01/2016 07:00 - 15:00: Guard Level 2 Regular 6.70 8.00
    6197 7435 04/01/2016 18:00 - 23:00: Guard Level 2 Regular 6.70 5.00
    6196 7435 05/01/2016 18:00 - 23:00: Guard Level 2 Regular 6.70 5.00
    6196 7435 06/01/2016 18:00 - 23:00: Guard Level 2 Regular 6.70 5.00
    6196 7435 07/01/2016 18:00 - 23:00: Guard Level 2 Regular 6.70 5.00
    6196 7435 08/01/2016 18:00 - 23:00: Guard Level 2 Regular 6.70 5.00
    6198 7435 09/01/2016 07:00 - 15:00: Guard Level 2 Regular 6.70 8.00
    6198 7435 10/01/2016 07:00 - 15:00: Guard Level 2 Regular 6.70 8.00
    6198 7435 11/01/2016 18:00 - 23:00: Guard Level 2 Regular 6.70 5.00
    6199 8956 31/01/2016 06:30 - 07:00: Site Visit Billable Not Payable 0.00 0.50
    6199 8956 31/01/2016 22:00 - 22:30: Site Visit Billable Not Payable 0.00 0.50
    6199 8957 22/01/2016 01:05 - 01:35: Mobile Super Billable Not Payable 0.00 0.50

    Here the sheets are to be created based on the first column and the total required for the last column, but all the other data is also to be populated in the respective sheet.

    In your earlier script i am a bit getting confused with the target commands. Apologies i am not that good at macro.

    Can you please help.

    Thanks in advance.

    Regards,
    Vinod
    Attached Files Attached Files
    Last edited by VinodN; 02-29-2016 at 03:05 AM. Reason: attachment uploaded

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: create sheets based on cell values with corresponding data

    Okay, edited-
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-27-2015
    Location
    Mumbai, India
    MS-Off Ver
    MS Office 2007
    Posts
    8

    Re: create sheets based on cell values with corresponding data

    Thank you once again. This time it has worked. Just one last query. The output of column E (To Time) is not coming as per the original data sheet. Can anything be done on that.

    Thanks.

    Regards,
    Vinod

  6. #6
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: create sheets based on cell values with corresponding data

    Okay, that was a formatting issue try this-
    Please Login or Register  to view this content.
    Check attached for reference.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-27-2015
    Location
    Mumbai, India
    MS-Off Ver
    MS Office 2007
    Posts
    8

    Re: create sheets based on cell values with corresponding data

    Hi Sourabh,

    Just one more help. Sorry to bother you. I tried with the formatting part but the command is going into loop and doing a formatting after every line is updated because of which it is taking time. Also need to give the data range till the data not beyond that. Also confused with where to insert the formatting script.

    I have attached the output file after formatting how it should appear.
    The data should be in borders
    The headers should be bold
    The Total word and the number should be in bold.

    Your help will be highly appreciated.

    Thanks.

    Regards,
    Vinod
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Create new sheets and copy/paste data based on values in a column or columns
    By quintans1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2015, 12:15 PM
  2. [SOLVED] VBA: Create new sheets based on cell value and copy data
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2015, 07:33 PM
  3. Replies: 0
    Last Post: 11-04-2013, 01:48 PM
  4. [SOLVED] Filter data on sheet1, create, and paste into new sheets based on cell value
    By minister in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2013, 09:16 PM
  5. How to create and populate sheets based upon cell values in master sheet?
    By mezzopiano1423 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2013, 12:51 PM
  6. [SOLVED] Add Data in Different Sheets and Result in Master Sheet based on Cell Values
    By dksodhi in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-18-2013, 01:08 PM
  7. Create/Name sheets based upon values
    By Miraun in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-01-2009, 12:11 PM

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