Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Making sheets with a macro
Hello everybody. I could really use some help with trying to do this.
I have run into an issue where i want to be able to create multiple sheets with a macro. I am trying to create a macro that can be used to see if a sheet "Insert Name" exists. The once it is verified then create an additional sheet called "Something Else". Also, I want to it to only add one planned sheet each time you run the macro and to name each new sheet differently. I would like to be able to do this for up to six new sheets. Is this even possible? If it is not possible please tell me so I do not waste more time trying. If it is possible I would really appreciate some help or hints on this subject. -James- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Making sheets with a macro
Hi James,
Sub Test() Dim i As Long Dim wks As Worksheet On Error Resume Next Set wks = ActiveWorkbook.Worksheets("Insert Name") If wks Is Nothing Then Set wks = ActiveWorkbook.Worksheets.Add wks.Move after:=Sheets(Sheets.Count) wks.Name = "Insert Name" End If Err.Clear For i = 1 To 6 Set wks = Worksheets("Something Else" & i) If Err.Number Then Exit For Else Err.Clear End If Next On Error GoTo 0 If i = 7 Then MsgBox "already 6" Else Worksheets.Add.Move after:=wks ActiveSheet.Name = "Something Else" & i End If End Sub Regards, Peter T "JamesJordan" wrote in message ups.com... Hello everybody. I could really use some help with trying to do this. I have run into an issue where i want to be able to create multiple sheets with a macro. I am trying to create a macro that can be used to see if a sheet "Insert Name" exists. The once it is verified then create an additional sheet called "Something Else". Also, I want to it to only add one planned sheet each time you run the macro and to name each new sheet differently. I would like to be able to do this for up to six new sheets. Is this even possible? If it is not possible please tell me so I do not waste more time trying. If it is possible I would really appreciate some help or hints on this subject. -James- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Making sheets with a macro
Thanks I will try that out. That should give me a good start. I will
already have a couple of sheets in the workbook. Also, I am messing with a macro to create a corresponding sheet for each sheet that is created. What it is, is that I will use the code you gave me to create a macro that makes multiple planned pages and then I hope to be able to run the another macro to create a planned vs. actual sheet for each of the planned sheets that exist. I appreciate your help! -James- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
making changes to existing sheets | New Users to Excel | |||
making changes to all sheets in a workbook | Excel Discussion (Misc queries) | |||
Making sheets visible / hidden | Excel Programming | |||
making an employee schedule in two sheets | Excel Worksheet Functions | |||
Making a function available in all sheets | Excel Programming |