Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating and naming new worksheets
I have macro to make a new sheet from a template. In this process, the user
is asked for an account name which is then used to name the sheet. How do I check to make sure that the same name does not already exist? Thanks, BradK |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating and naming new worksheets
Hi Brad
You can use this function to check it Function SheetExists(SName As String, _ Optional ByVal WB As Workbook) As Boolean 'Chip Pearson On Error Resume Next If WB Is Nothing Then Set WB = ThisWorkbook SheetExists = CBool(Len(WB.Sheets(SName).Name)) End Function And use If SheetExists(yourstring) = False Then..... -- Regards Ron de Bruin http://www.rondebruin.nl "Brad K." wrote in message ... I have macro to make a new sheet from a template. In this process, the user is asked for an account name which is then used to name the sheet. How do I check to make sure that the same name does not already exist? Thanks, BradK |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating/Naming New Worksheets Based on Select Cells in Master Worksheet | Excel Worksheet Functions | |||
Naming worksheets | Excel Programming | |||
Creating & Naming a New Worksheet | Excel Programming | |||
naming worksheets | Excel Worksheet Functions | |||
Worksheets Add & Naming | Excel Programming |