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

I need help changing this macro I received from Vergel Adriano. It works but
I would like it to always move all the files in F:\temp and not ask me were
the source is and I was wondering if it could ask me to browse to the
destination location so I wouldn't have to type it in the Imput box. Is this
possible??? Thanks,

Sub test()
Dim strSource As String
Dim strDest As String
Dim strFileName As String

strSource = InputBox("Enter source folder path")
strDest = InputBox("Enter destination folder path")

strFileName = Dir(strSource, vbDirectory)
If strFileName = "" Then
MsgBox "Source Folder path is invalid", vbCritical
Exit Sub
End If

strFileName = Dir(strDest, vbDirectory)
If strFileName = "" Then
MsgBox "Destination Folder path is invalid", vbCritical
Exit Sub
End If

strFileName = Dir(strSource & "\*.*")
While strFileName < ""
Name strSource & "\" & strFileName As strDest & "\" & strFileName
strFileName = Dir
Wend

End Sub

 
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
Chart macro okay but sometimes ends by moving to a new location? James A Excel Programming 1 December 17th 06 07:58 PM
location for add-in files keithb Excel Programming 1 September 13th 05 08:15 AM
Moving Cursor & Sheet back to the Original Location Ricky Pang Excel Programming 2 July 8th 05 04:18 PM
moving to relative location after finding data Frank Kabel Excel Programming 1 March 3rd 04 06:57 PM
keeping track of stock moving from one location to another DL[_3_] Excel Programming 4 September 1st 03 10:09 PM


All times are GMT +1. The time now is 03:24 PM.

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"