+ Reply to Thread
Results 1 to 4 of 4

VBA Macro to Save Workbook as cell date + Default name with conditions

  1. #1
    Registered User
    Join Date
    06-21-2015
    Location
    fort lauderdale, florida
    MS-Off Ver
    2007
    Posts
    77

    VBA Macro to Save Workbook as cell date + Default name with conditions

    Hi !

    I work on small family company, and i have an issue to save workbook. i know that to save a WB in VBA is easy using default name but my boss ask me to save it on special way and to be honest this time don't seems to be easy because the conditions. (i know a lil bit of formulas and some VBA and still learning )

    This is the problem :

    Worksheet Default name is : Ord-Prep-Shipped.xlsb

    There are 3 cells with date
    Dates Example:
    Cell C37 ->When Customer place the order on Jun 16 (Cell C37 display =====> Jun 16
    Cell G12 ->When Coworker prepare the Order Next day Jun 17 (Cell G12 display => Jun 17
    Cell P12 ->When CoWorker went to Deliver the order (same date when prepared) on Jun 17 (Cell P12 display => Jun 17

    So the condition is :
    If Cells G12 and P12 have same date and C37 is 1 day early Save Worksheet as G12 Date with default Name

    Example of new Worksheet Name : Jun 17 Ord-Prep-Shipped.xlsb

    But

    If date in Cell G12 and P12 not match Then Not save Worksheet and display an error msg -> "Check Procedure Order"

    I know that is possible to do it with VBA, but it is possible that a friend help me?



    Thanks a million in advance!
    Last edited by Franky alta; 06-17-2017 at 08:20 AM. Reason: eliminate the word based (is not what i try to say)

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA Macro to Save Workbook as cell date + Default name with conditions

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-21-2015
    Location
    fort lauderdale, florida
    MS-Off Ver
    2007
    Posts
    77

    Re: VBA Macro to Save Workbook as cell date + Default name with conditions

    Hi,

    Can someone help me to modify the code?, The code it doing the job perfect But just on first record, it look the condition, create the msg box and save the worksheet using the cell date and add the Default name,(But because we use the same worksheet as template, then here is the problem)
    For example :
    First record it save Perfect as:
    1st--> Jun 10-Ord-Prep-Shipped.xlsb
    2nd--> it save as Jun 11 Jun 10-Ord-Prep-Shipped.xlsb
    3rd---> it save as -> Jun 12 Jun11-Jun10-Prep-Shipped.xlsb
    And it keep addin date on the file name when updating new order and saved.

    I need to save the file with the cell date plus Default name and keep loaded the file when input another order, and save it i need the vba to save the file name replacing just the date (depending cell date on ) but keeping the default name.
    i need to keep individual record, Example of desire saved file Record:
    1st--> Jun 10-Ord-Prep-Shipped.xlsb
    2nd--> Jun 11-Ord-Prep-Shipped.xlsb
    3rd---> Jun 12-Ord-Prep-Shipped.xlsb


    Thanks, appreciated!!
    Last edited by Franky alta; 06-17-2017 at 05:46 PM. Reason: bold the record name

  4. #4
    Registered User
    Join Date
    06-21-2015
    Location
    fort lauderdale, florida
    MS-Off Ver
    2007
    Posts
    77

    Re: VBA Macro to Save Workbook as cell date + Default name with conditions

    Hello my friends,

    The problem is Solved.. Thanks to the code of Mr AlphaFrog.

    In a hidden cell B13 i wrote the Default Name : Ord-Prep-Shipped
    and replaced this line of code:
    Please Login or Register  to view this content.
    For this one :
    Please Login or Register  to view this content.

    Thank you very much!!!

+ 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. macro to "save workbook" based on cell value
    By semajjames in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2015, 04:11 PM
  2. Macro to save workbook in locations based on the date
    By hawk77EF in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2015, 01:49 AM
  3. [SOLVED] Macro to save file - save name from cell containing a date using different date formatting
    By d_max_c in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2014, 12:18 PM
  4. Macro - Get adjacent cell values based on a condition & save as a different workbook
    By ManInRed in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-14-2013, 10:25 AM
  5. [SOLVED] Set default Save-As parameter to Macro Enabled workbook
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-24-2013, 09:26 AM
  6. [SOLVED] Open a new workbook, save with date from cell in workbook.
    By rlh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2013, 10:07 AM
  7. [SOLVED] Macro to Save File to Location Folder Based on Date in Cell
    By John_Day83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2013, 05:34 PM

Tags for this Thread

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