+ Reply to Thread
Results 1 to 3 of 3

entering a monthly changing work book name into a macro

Hybrid View

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    swindon
    MS-Off Ver
    Excel 2003
    Posts
    26

    entering a monthly changing work book name into a macro

    ok guys and girls i have a workbook that is doing a copy and paste between 2 workbooks.

    the trouble i am having is every month workbook a changes to be the name of the current month and year workbook b never changes.
    so when a change in month happens the macro stops working due to new workbook name.

    how could i have the macro reed the name of the work book and input that name into the necessary locations withing the macro.

    i have looked across the internet and found no solution.

  2. #2
    Registered User
    Join Date
    07-04-2012
    Location
    swindon
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: entering a monthly changing work book name into a macro

    sorry this is a small idea of what i have at the mo

    Workbooks.Open Filename:="C:\Users\Emily\Documents\Covers List.xls"
    ActiveWindow.WindowState = xlNormal
    Windows("Book1").Activate
    Selection.Copy
    Windows("Covers List.xls").Activate
    ActiveWindow.SmallScroll Down:=24
    Range("B35").Select
    ActiveSheet.Paste
    Windows("Book1").Activate

    so book 1 changes monthly so would normally look like 01 jan 2014.xls and so on and cover list never changes.

    how can i get the macro to get the book1 from the file name?

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    swindon
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: entering a monthly changing work book name into a macro

    i believe i have stumbled across an answer but will not know until monday so any suggestions will great.

+ 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] Auto run macro after entering/changing the date
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-10-2014, 11:02 PM
  2. [SOLVED] Macro to generate new work book
    By kriahnadas.oo7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2013, 08:47 AM
  3. Replies: 2
    Last Post: 06-20-2012, 05:10 AM
  4. how to get a macro to work with any work book name
    By Wade LEES in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-24-2009, 06:18 AM
  5. Replies: 1
    Last Post: 07-04-2005, 05: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