Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Move them to different folder

Hi,

Is there any way, using Excel VBA code, we can move a worksheet from
one folder on the system to another. Can someone give me an example
code.

Thanks in advance
Prasad Vanka
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Move them to different folder

Sub move()
Dim path As String
Dim fil_nam As String

path = "D:/" ' Specify Path you want to move to, you can also do this by
'passing a vairable
fil_nam = ActiveWorkbook.Name
del_file = ActiveWorkbook.FullName

ActiveWorkbook.SaveAs (path & fil_nam)
Kill ActiveWorkbook.Name
End Sub


Prasad Vanka wrote:

Hi,

Is there any way, using Excel VBA code, we can move a worksheet from
one folder on the system to another. Can someone give me an example
code.

Thanks in advance
Prasad Vanka


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Move them to different folder

More simply

name "C:\myTest\Volker1.xls" as "C:\NewDir\Volker99.xls"

note that NewDir must exist already.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"yogendra joshi" wrote in message
...
Sub move()
Dim path As String
Dim fil_nam As String

path = "D:/" ' Specify Path you want to move to, you can also do this by
'passing a vairable
fil_nam = ActiveWorkbook.Name
del_file = ActiveWorkbook.FullName

ActiveWorkbook.SaveAs (path & fil_nam)
Kill ActiveWorkbook.Name
End Sub


Prasad Vanka wrote:

Hi,

Is there any way, using Excel VBA code, we can move a worksheet from
one folder on the system to another. Can someone give me an example
code.

Thanks in advance
Prasad Vanka




Reply
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
VBA to move an excel file to another folder tvt Excel Discussion (Misc queries) 3 December 19th 13 02:53 PM
Move Active Workbook to another Folder jonallen51 Excel Discussion (Misc queries) 0 March 12th 08 07:41 PM
move a sheet out of my workbook and place in another folder? trishb123 Excel Discussion (Misc queries) 3 January 10th 07 04:14 PM
Move Folder Contents Dave Peterson[_3_] Excel Programming 2 May 10th 04 03:36 PM
Move file to different folder Don Guillett[_4_] Excel Programming 4 August 29th 03 07:35 PM


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