Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
Sub AddSheetIF() myname = InputBox("What name") On Error Resume Next If worksheets(myname) Is Nothing Then worksheets.Add.Name = myname End If End Sub -- Don Guillett SalesAid Software "tango" wrote in message om... dear all, i want to add new worksheet if the worksheet name is not found in the workbook when user input in the inputbox. tosheet is the variable input by user. ** this if statement is incorrect. how should i write the statement? If Worksheets(tosheet).Name not found in the workbook then ** this line is correct. Set ws = ThisWorkbook.Worksheets.Add(after:=ThisWorkbook.Sh eets(ThisWorkbook.Sheets.C ount)) End If thanks alot |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete values in sheet 2 that arre found in sheet 1 | Excel Discussion (Misc queries) | |||
If ID # on one sheet isn't found on another... | Excel Worksheet Functions | |||
how can I format sheet 1 if the value is found in sheet 2? | New Users to Excel | |||
Do same thing to each workbook found in a folder | Excel Programming | |||
Jump to next sheet if not found | Excel Programming |