LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default does code for this exist? help please

We use this basic one for file moves. Cant find the better coded macro, but
this will get you by:
--------------------------
Dim fso2
Dim DestPath, SourcePath, CurrentFileName As String

Set fso2 = CreateObject("Scripting.FileSystemObject")
DestPath = Range("$C$2").Value 'Destination File Path
SourcePath = Range("$C$4").Value 'Source File Path
Range("$K$3").Activate 'This would be your C3 cell.
Do 'U may not need this loop as you may only be copying one file
CurrentFileName = ActiveCell.Value
fso2.CopyFile SourcePath & CurrentFileName & ".xls", DestPath
ActiveCell.Offset(1, 0).Activate
If ActiveCell.Value = Empty Then Exit Do
Loop
------------------------------------------------


"short_n_curly" wrote:


it woks like this if cell c3 = "Archived" then
workbooks(range(d3)).value is cut from file
ChDir "C:\Documents and Settings\Carl\Desktop\Personal Training
Clients"
and is pasted into file
ChDir "C:\Documents and Settings\Carl\Desktop\Archived Files"

can i cut the workbook (i.e this workbook is not open) this code comes
from a seperate workbook, what i am asking is that i have the code to
rename files based upon cell contents and even code to open workbooks
in the same way but there seem to be no option to cut the workbook and
paste it into the desination folder, can this be done

hope this breakdown helps thanks for the replies so far keep them
coming please:)


--
short_n_curly
------------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...o&userid=21576
View this thread: http://www.excelforum.com/showthread...hreadid=384157




 
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
text exist gpurdue Excel Discussion (Misc queries) 3 August 14th 09 04:24 PM
Exist or Not. ldiaz Excel Discussion (Misc queries) 3 September 6th 06 09:31 PM
Am I Looking For Something That Doesn't Exist? seanryann Excel Discussion (Misc queries) 11 April 1st 06 06:10 PM
Does a worksheet exist Kaval[_2_] Excel Programming 3 May 31st 04 07:21 AM
does a file exist? Keith Willshaw Excel Programming 0 September 10th 03 04:42 PM


All times are GMT +1. The time now is 04:49 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"