Results 1 to 10 of 10

Code to set workbook name (dynamic)

Threaded View

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    liverpool
    MS-Off Ver
    Excel 2007
    Posts
    67

    Code to set workbook name (dynamic)

    Hi,

    Is there a way in which I can get the “Set Workbooks name” to come from a cell value within excel, instead of setting the filename from the vba code as shown below:

    I want the operator to not have to go into the code, so entering the name in a sheet is preferred then running a macro is preferred.


    Example code:

    
     Sub CopyDWOR()
    
     Dim SourceWB As Workbook
     Dim DestinationWB As Workbook
    
     Set SourceWB = Workbooks("DWOR Line 5 Week 15 Old .xlsm")
     Set DestinationWB = Workbooks("DWOR Line 5 Week 15 2017.xlsm")
    
    
     ' Sunday AM
    
     ' Copy & Paste SKUs
     SourceWB.Sheets("Sun AM").Range("C43:D57").Copy
     DestinationWB.Sheets("Sun AM").Range("C43").PasteSpecial
    
     ' Copy & Paste Plan Cases
     SourceWB.Sheets("Sun AM").Range("G43:R57").Copy
     DestinationWB.Sheets("Sun AM").Range("G43").PasteSpecial
    
     End Sub

    Many thanks in advance.
    Tom.
    Last edited by tompee29; 04-27-2017 at 05:05 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-28-2015, 08:30 AM
  2. [SOLVED] VBA Code to export dynamic excel tabs to new workbook
    By savetrees in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2014, 12:25 PM
  3. [SOLVED] Very Complicated Code to Copy dynamic data from one workbook to other workbooks
    By mannuhs in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-30-2013, 02:22 PM
  4. vb6 code to copy cell value from one workbook to another and it should be dynamic
    By sidhemu in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-08-2013, 10:23 AM
  5. VBA Code to insert dynamic data from sperate workbook to chart
    By Policeme21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2012, 04:33 PM
  6. Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-28-2011, 05:42 AM
  7. Code creates new workbook-> code to automatically run a set code on that workbook
    By cwalker6 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2009, 08:00 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