View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Macro to create worksheets base on name

this should hopefully get you started:

Sub InsertNewSheetAndName()

Dim SheetName As String

SheetName = InputBox("Please Enter New Worksheet Name:")
Sheets.Add
ActiveSheet.Name = SheetName

End Sub

Cheers,
Al

"unplugs " wrote:

I have 2 workbooks.
Name:Database workbook and Employee workbook.

FOr the Database workbook, I got 30 worksheets in it which I define the
range, and I give the worksheet name for each of the 30 employees.

when I open the Employee worksheet, the particular data for each
employees from the Database workbook will be copy over to employee
workbook. Employee will make their entries there, then save it. The
data that save will then copy and paste to the particular worksheets in
the Database workbook.

This work great for me! Anyway, my boss ask me to do it more easily so
that they can add/ delete employees in the Database workbook easier.

How can I do such that, when I key in employee name, and click on "ADD"
button in userform, it will create a new worksheet which the
worksheet's name is the Employee name? After create the worksheet, I
would like the macro to define the range for the worksheets(So that I
can copy & Paste using this range).

How to do this using code?

Hoping for someone to shed the light for me.

THanks in advance.


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