Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I'm trying to create a number of new worksheets based on the information in a
column on the original worksheet, and then copy the information from the original sheet onto the relevent new sheet. I want to trap errors by first checking if the required sheet exists before trying to create it, but I don't know how to do this. |
#2
![]() |
|||
|
|||
![]()
Hi Lizzie
You can copy this function in a normal module 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 this in your code in your loop If SheetExists(cell.Value) = False Then -- Regards Ron de Bruin http://www.rondebruin.nl "LizzieHW" wrote in message ... I'm trying to create a number of new worksheets based on the information in a column on the original worksheet, and then copy the information from the original sheet onto the relevent new sheet. I want to trap errors by first checking if the required sheet exists before trying to create it, but I don't know how to do this. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Only calculate specific worksheet automatically? | Excel Worksheet Functions | |||
Linking cells in a worksheet to other worksheets in a workbook | Excel Discussion (Misc queries) | |||
IF WorkSheet1 A1=1 then put value of WS1 B2 in WS2 C3 else donothi | Excel Worksheet Functions | |||
drop down menu containing worksheet names | Excel Worksheet Functions | |||
copyright and worksheet protection | Excel Discussion (Misc queries) |