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

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

macro to create worksheet

Reply to Message Icon

Original Message
Name: stewie09
Date: September 8, 2006 at 13:44:57 Pacific
Subject: macro to create worksheet
OS: Windows 2000 Pro
CPU/Ram: P4 1.2 GHz with 256 RAM
Model/Manufacturer: 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


Report Offensive Message For Removal


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

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


Report Offensive Follow Up For Removal







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








Do you own an iPhone?

Yes
No, but soon
No


View Results

Poll Finishes In 7 Days.
Discuss in The Lounge
Poll History




Data Recovery Software