+ Reply to Thread
Results 1 to 5 of 5

Looking for a macro the auto add sheets based on data, add the data and hide the sheets.So

  1. #1
    Registered User
    Join Date
    11-28-2015
    Location
    Blagoevgrad, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    Looking for a macro the auto add sheets based on data, add the data and hide the sheets.So

    So basically, I have a sheet named Form that the user puts data in and then a button to automatically add the data in a new sheet named Data. In the Data worksheet I have a table and the last column is named Week. I have made a formula to state the Week number starting from Monday. For example, I log in first entry on 11-28-2015 and it is considered week 1. If I log in entry the next day 11-29-2015 it is going to be week 1 again, but if I log in entry on 11-30-2015 it is going to be Monday and it is going to say Week 2.
    And then I need a macro that is going to automatically make sheets named "Week #" and add all the data in the worksheet from that Week. And then I want the sheets hidden and I am going to add a button how to hide/unhide them. (I know how to do that)
    Basically, I need a sheet for every week.
    I tried something but I kept getting an error because I have duplicates in week numbers so the system was trying to make worksheet "Week 1" and then for the next entry again "Week 1".
    I am new to excel and know little about VB.
    Data worksheet week numbering starts from G4 and keeps going down.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Looking for a macro the auto add sheets based on data, add the data and hide the sheet

    Hi, and welcome to the forum.
    If you upload the workbook no doubt we can advise further.

    However before going too far with what sounds like a new development I'd urge you to consider why you need to create separate sheets for each week.
    Usually it's much better to create a proper normalised 2 dimensional database on single sheet. Once you have a pukka database then the world is your lobster (as they don't say).

    With a proper database you can always report a particular week of data, or in fact any period of data and output it if absolutely necessary to another sheet, or analyse it with a Pivot Table and any other number of options. If you start out with data spread across many sheets you are just storing up problems.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-28-2015
    Location
    Blagoevgrad, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    Re: Looking for a macro the auto add sheets based on data, add the data and hide the sheet

    Thanks for your response.
    upload.xlsm
    It is a project I am working on. It is a hypothetical work calculator. I want to have separate sheets for every week to see how much I worked every day. I am really new to excel and I don't really understand what you mean by the database. If you could ELI5 i would be grateful.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Looking for a macro the auto add sheets based on data, add the data and hide the sheet

    Hi,

    Yes you're on the right lines with the Data sheet, although I'd suggest that you don't need to include the week number or the Day. These can both be derived from the date when you need to create a report. The only question is do you really need to create separate sheets for each week? You could have a single weekly template sheet and populate that with a Data Advanced Filter using a prompt for the week's start date as the One of two criteria cells for the filter, The other criteria cells would use the first criiteria cell plus 7

  5. #5
    Registered User
    Join Date
    11-28-2015
    Location
    Blagoevgrad, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    Re: Looking for a macro the auto add sheets based on data, add the data and hide the sheet

    I guess I don't really need to do seperate sheets for each week. I just thought it would be cool to have the information whenever I need it. My initial idea was to get data for every day and then compute the check and then in the summary add every check by week and see what I made for the whole summer. I was thinking of adding a line chart aswell to see which weeks i made the most money.
    This is a class project I am working on. We haven't really made macros in class and we haven't covered Data Advanced Filters. So any ideas on how to make this would be greatly appreciated.
    I really like excel that's why I am doing more than what we've covered in class. I just want to make it good and complicated

+ 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. Auto Populate New Sheet Based on Data from Multiple Other Sheets
    By NateD in forum Excel Charting & Pivots
    Replies: 15
    Last Post: 04-28-2015, 03:00 PM
  2. Auto hide/unhide sheets based on selection
    By Gifted Ed in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2014, 12:25 AM
  3. Auto Populate Sheets Based on a Data Tab???
    By dwmilligan in forum Excel General
    Replies: 3
    Last Post: 10-30-2014, 11:02 AM
  4. How to auto hide/unhide sheets in excel workbook based on cell input?
    By bensaps10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2014, 09:57 AM
  5. Macro to auto log data between sheets
    By freud1 in forum Excel General
    Replies: 1
    Last Post: 12-15-2008, 11:10 AM
  6. Data Validation + macro to hide sheets
    By Christoffer_Col in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2008, 04:59 AM
  7. Hide Certain Sheets based on Cell Data
    By Volsfan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2005, 10:05 AM

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