+ Reply to Thread
Results 1 to 6 of 6

Save sheet to new sheet and name it based on date on first sheet cell

  1. #1
    Registered User
    Join Date
    01-09-2015
    Location
    Illinois, USA
    MS-Off Ver
    2013
    Posts
    63

    Save sheet to new sheet and name it based on date on first sheet cell

    Trucking Orders Saturday testing 0623 am.xlsm

    I have received some help, still having some trouble.

    What I am trying to do is copy and save a sheet named "Daily Order" This sheet gathers truck orders (#1 - #10) throughout the day from a user form and at the end of the day I want to save it to a new sheet named the date the orders are for based on a cell with the date entered in the "Daily Order" sheet - in Cell "D11"

    I wish the macro to be performed when I select the "Save Daily to new tab & Clear data for next day" button
    After the new sheet is saved I wish to clear all data on the "Daily Order" sheet ranges "B2,L11", I then wish to change the cell colors on the "Daily Order" sheet Ranges "A2,L11" back to white.

    Data in "A1,A11" must stay !

    I do not want to delete the original "Daily Order" sheet as it will be used to gather data for next day's order.

    Below is the code I am trying to tweak if it will work. It was sent to me by Ciao Holger


    Code:
    ---------
    Sub EF1074585_A()
    'will create a new sheet with a date as name of a template
    Dim ws As Worksheet
    Dim strName As String

    Set ws = Sheets("Daily order")
    strName = Format(ws.Range("B4").Value, "yyyy_mm_dd")
    If Not Evaluate("ISREF('" & strName & "'!A1)") Then
    ws.Visible = xlSheetVisible
    ws.Copy After:=Worksheets(Worksheets.Count)
    ActiveSheet.Name = strName
    ws.Visible = xlSheetVeryHidden
    End If
    Set ws = Nothing
    End Sub


    As always I appreciate any help solving this very much.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Save sheet to new sheet and name it based on date on first sheet cell

    Try it like this:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Save sheet to new sheet and name it based on date on first sheet cell

    Him, Dennis,

    you would need to wrap ypur code with code-tags according to Forum Rule 3.

    I wonder why I mentioned here
    ... I would recommend to test but really not use it as the area to delete and add new date are still missing
    and see you starting a new thread on the very same topic instead of asking in the linked one.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    01-09-2015
    Location
    Illinois, USA
    MS-Off Ver
    2013
    Posts
    63

    Re: Save sheet to new sheet and name it based on date on first sheet cell

    Sorry for my errors on how to correctly respond for continued issues. I will get it figured out.

    Bernie,
    It works great, only thing missing is I wish Cells (A2-A11) on the original "Daily Order" tab background color be changed to white after clearing other data.
    I may not have been clear But the Data (Order # 1 - Order # 10) in (Cells A2-A11) on the "Daily Order" Tab Needs to stay in place but change background color to white. This is because as orders are entered it will then be shaded to reflect time orders are called in.

    I truly appreciate the fast response and expertise help from all.

    Thanks, Dennis

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Save sheet to new sheet and name it based on date on first sheet cell

    Oh, OK - try this one:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-09-2015
    Location
    Illinois, USA
    MS-Off Ver
    2013
    Posts
    63

    Re: Save sheet to new sheet and name it based on date on first sheet cell

    WOW Bernie Perfect.

    As Always I appreciate everyone's knowledge and help

    Dennis

+ 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] Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.
    By Gezza24 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-05-2013, 12:50 AM
  2. [SOLVED] Copy Data and paste it in new sheet and save new sheet as value of cell a2
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2013, 08:55 AM
  3. Replies: 8
    Last Post: 01-31-2013, 02:55 AM
  4. Replies: 7
    Last Post: 12-16-2012, 04:24 PM
  5. [SOLVED] Macro to Copy Data from one Sheet A to Sheet B based on value in cell on sheet A
    By scass in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 07:21 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