Computing.Net > Forums > Office Software > macro to create worksheet

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

macro to create worksheet

Reply to Message Icon

Name: stewie09
Date: September 8, 2006 at 13:44:57 Pacific
OS: Windows 2000 Pro
CPU/Ram: P4 1.2 GHz with 256 RAM
Product: Dell
Comment:

I need your help with macro, please. I am creating an Excel spreadsheet, the first worksheet is used as a control screen. I created a worksheet that I will use as a calendar template.
I want to create a macro that will allow me to enter a name in a box or field, and then when I click on a button (name create user Calendar) which is assigned to the macro, the macro will
Copy the name I entered
Make of copy of the worksheet (named Calendar template) and rename the newly copied worksheet using the name I entered early. Can you help me to accomplish this? I would really appreciate it. Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: rhawk7938
Date: September 8, 2006 at 17:23:24 Pacific
Reply:

This is very basic but might give you the idea. Obviously the file location would have to be changed to your template location. When you run it, it will open the template and ask for a new file name and then save it in the same location with the new name as an xls file. (Note: Workbooks.open to Editable:=True, is all one line of code.)

Sub RenameFile()

Workbooks.Open Filename:="C:\Documents and Settings\My Documents\Excel\Calender.xlt", Editable:=True

FName = InputBox("Enter a file name")

ActiveWorkbook.SaveAs Filename:=FName


End Sub


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: macro to create worksheet

macro to add footer at print www.computing.net/answers/office/macro-to-add-footer-at-print/4998.html

Macro to carry over totals www.computing.net/answers/office/macro-to-carry-over-totals/6823.html

Excel Macro to Save As www.computing.net/answers/office/excel-macro-to-save-as/7469.html