View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tushar Mehta Tushar Mehta is offline
external usenet poster
 
Posts: 1,071
Default copy files from one dir to another

Suppose the cell is C1. Then use

oldname = "C:\" & range("C1").value
newname = "\\....\" & range("C1").value

To be more specific about which workbook and which worksheet, use
workbooks("wbk name here").Worksheets("wks name here").range
("C1").value
--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , rvik
says...
hai

a cell address contains a file name. i want the file name in the cell
address to be the input for the code below, so that the file is copied
to a new location....i.e. instead of the "test.doc", i should have the
file name mentioned in the cell address


Sub file_trf_copy()
oldname = "C:\test.doc"
newname = "\\....\test.doc"
FileCopy oldname, newname
End Sub
test.doc


---
Message posted from http://www.ExcelForum.com/