LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving a workbook


I've got a base solution if anyone is interested:

The code gets the workwook in the source folder and then moves it into
an archive folder with date of the move attached to the front.


Code:
--------------------
Public Sub Move_rename_workbook()

Dim bookpath As String
Dim wkbkname As String
Dim actiondate As String
Dim dateofchange As String
Dim newname As String
Dim OldFilePath As String
Dim NewFilePath As String

Const sourcepath = "P:\VBA training\Test_folder\"
Const archivepath = "P:\VBA training\archive\"

wkbkname = Dir(sourcepath & "*.xls")

bookpath = sourcepath & wkbkname

actiondate = Format(Now(), "ddmmyyyy")

newname = (actiondate) & "_" & wkbkname

OldFilePath = bookpath
NewFilePath = archivepath & newname

Name OldFilePath As NewFilePath

End Sub
--------------------


--
Daminc
------------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=534196

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Data between sheets in the same workbook and moving data between Workbooks. Alison Brown Excel Worksheet Functions 0 February 10th 09 01:03 AM
Moving data from one workbook to another workbook Mike Rogers[_2_] Setting up and Configuration of Excel 1 February 9th 09 03:45 PM
Moving Within A Workbook Jasmyn Excel Discussion (Misc queries) 2 October 30th 08 03:07 PM
Moving Cell Information from one workbook into another workbook [email protected] Excel Worksheet Functions 2 January 25th 07 02:26 AM
Moving one workbook page to a new workbook edver Excel Worksheet Functions 1 July 19th 05 11:47 PM


All times are GMT +1. The time now is 06:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"