+ Reply to Thread
Results 1 to 3 of 3

Duplicate Workbook, change 1 cell and save with name according cell

  1. #1
    Registered User
    Join Date
    08-20-2020
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Duplicate Workbook, change 1 cell and save with name according cell

    Hi guys!

    I need HELP please

    I need to have a Macro that Duplicates an Excel file, then goes to Sheet1 (cell B2) and replaces the Date for the first date available in Sheet3 (Column B) and finally saves the file with the name of Sheet3 (Column B, respecting the same format, ex: "2020-12-01"). The duplicated file should be .xlsm and saved in the same folder where the original file is.

    This process has to be repeated until the next line in Sheet3 (column B) is empty.

    I'm attaching the file to try to make it easier.

    THANKS A LOT!!!

    Luisa
    Attached Files Attached Files
    Last edited by luisacorreaj; 12-06-2020 at 11:21 PM.

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Duplicate Workbook, change 1 cell and save with name according cell

    See if this can do

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Registered User
    Join Date
    08-20-2020
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Duplicate Workbook, change 1 cell and save with name according cell

    Hi Leo,

    Thanks for your help.

    I changed the code a little bit because it was not copying all the sheets and I was loosing the Data Validation drop-down lists. But I used your code as structure

    Here is the final code I'm using:

    Sub Copy()
    Application.ScreenUpdating = False
    With Sheets("MACRO")
    lr = .Range("B" & .Rows.Count).End(xlUp).Row
    For x = 5 To lr
    Sheets("Log").Range("B2") = Sheets("MACRO").Range("B" & x)
    Worksheets("Drop Downs").Visible = False
    Worksheets("MACRO").Visible = False
    ActiveWorkbook.SaveAs (ThisWorkbook.Path & "\" & Format(.Range("B" & x), "yyyy-mm-dd") & ".xlsm"), FileFormat:=52
    Next
    End With
    End Sub

    Thanks a lot!

    Luisa

+ 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. Excel doesn't change the cell format on save through the workbook save button
    By mitko1994 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-16-2017, 03:09 PM
  2. Change cell fill color for all cells in a workbook based on a cell value
    By HDeuce in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2017, 06:01 PM
  3. [SOLVED] Macro to open workbook, change cell value and save
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2013, 01:27 PM
  4. Replies: 3
    Last Post: 07-11-2013, 03:01 AM
  5. Automatically save file with cell value + copy cell values to other workbook
    By notquitetheguru in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2013, 07:04 AM
  6. Macro to save duplicate file and create folder name based on cell value
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-19-2012, 12:09 PM
  7. A change to any cell in column I will trigger workbook.save
    By hensucker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2012, 11:22 AM

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