Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to add a new sheet with a name
Hi I'm trying to add a sheet for so to name it "formulas". How can I do that? -- Ctech ------------------------------------------------------------------------ Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745 View this thread: http://www.excelforum.com/showthread...hreadid=500157 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to add a new sheet with a name
The following code checks all the worksheets in the workbook to see if there
is sheet named "Formulas" already present in the file. If it does exist, nothing happens, if it doesn't exist a new worksheet is added and named. Sub AddSheet() Dim ws As Worksheet Dim wb As Workbook Dim strName As String Dim blnFound As Boolean Set wb = ActiveWorkbook For Each ws In wb.Worksheets strName = ws.Name If strName = "Formulas" Then blnFound = True Exit For Else blnFound = False End If Next ws If Not blnFound Then ActiveWorkbook.Worksheets.Add ActiveSheet.Name = "Formulas" End If End Sub -- Kevin Backmann "Ctech" wrote: Hi I'm trying to add a sheet for so to name it "formulas". How can I do that? -- Ctech ------------------------------------------------------------------------ Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745 View this thread: http://www.excelforum.com/showthread...hreadid=500157 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel sheet bootom half sheet goes behind top part of sheet | Excel Worksheet Functions | |||
Duplicate sheet, autonumber sheet, record data on another sheet | Excel Worksheet Functions | |||
Copying cells from on sheet to another sheet (via sheet module) | Excel Programming | |||
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. | Excel Discussion (Misc queries) | |||
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B | Excel Programming |