Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Im opening up a workbook and then selecting a worksheet based on string variable like so (wsI is worksheet variable, sYear is searc criteria) Set wsI = Sheets(sYear) I would like to improve this so that if the worksheet does not exist insert a new one and then rename it to my search variable, i though something along the lines of the below would work but it hasn't! guess the 0 is the wrong thing to look for, any help appreciated If Sheets(sYear) = 0 Then Sheets.Add ActiveSheet.Name = sYear Else Set wsI = Sheets(sYear) End I -- cereldin ----------------------------------------------------------------------- cereldine's Profile: http://www.excelforum.com/member.php...fo&userid=3206 View this thread: http://www.excelforum.com/showthread.php?threadid=53500 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
search if cell contents exist in other cells | Excel Worksheet Functions | |||
File opens as worksheet.xls:1 and worksheet.xls:2. Only one exist | Excel Programming | |||
Insert if not exist | Excel Programming | |||
How do i insert lines into a worksheet depending on if data exist. | Excel Programming | |||
search range, if exist, copy cell | Excel Programming |