PC Review


Reply
Thread Tools Rate Thread

copy using name define

 
 
New Member
Join Date: Aug 2010
Posts: 1
 
      3rd Aug 2010
how to... copy a workbook and rename using a range of cells (name define-there are 2 of them but only one listed below for testing). Each filename should be a concatenate string. And should close the file after creating. 1Sub createbudgetforms()
2Dim SaveDriveDir As String, MyPath As String
3Dim FName As Variant, N As Long
4Dim rnum As Long, destrange As Range
5Dim sh As Worksheet
6ChDir "c:\Budget\2011"
7Workbooks.Open(Filename:="c:\Budget\2011\IT_BudgetTemplate_.xls"). _
8RunAutoMacros Which:=xlAutoOpen
9Windows("Operatingbudgettemplate.xls").Activate
10Sheets("data").Select
11Application.Goto Reference:="Budget_forms"
12Range("B4:B60").Select
13ActiveWorkbook.SaveAs Filename:=FName, _
14FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
15ReadOnlyRecommended:=False, CreateBackup:=False
16GetData FName(N), "budget_forms", "b4:b60", destrange.Offset(1, 0), False, False
17ActiveWorkbook.SaveAs Filename:=file_name
18ActiveWorkbook.RunAutoMacros Which:=xlAutoClose
19ActiveWorkbook.Close
20Next
21End If
22End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Microsoft Windows 2000 Active Directory 1 17th Feb 2009 01:31 PM
Copy/Paste Charts; Define Destination of Charts in PowerPoint ryguy7272 Microsoft Excel Programming 2 24th Jan 2008 08:04 PM
Copy every 3rd cell, define destination range for paste =?Utf-8?B?TWVsdGFk?= Microsoft Excel Programming 1 27th Sep 2006 01:46 PM
Define: Shallow copy v. Deep copy Christoph Boget Microsoft C# .NET 11 31st Jul 2004 10:33 AM
define my own / get "copy of" when moving/copying files Alan Windows XP General 1 16th Jun 2004 03:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:00 PM.