Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chart macro okay but sometimes ends by moving to a new location? | Excel Programming | |||
location for add-in files | Excel Programming | |||
Moving Cursor & Sheet back to the Original Location | Excel Programming | |||
moving to relative location after finding data | Excel Programming | |||
keeping track of stock moving from one location to another | Excel Programming |