Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub nosheet()
isthere = False For Each w In Worksheets If w.Name = "Sheetxx" Then isthere = True End If Next If isthere Then MsgBox ("it's already there") Else MsgBox ("It's not there") End If End Sub -- Gary''s Student gsnu200711 "jb" wrote: I'm trying to run a macro, but sometimes theres a worksheet in place and sometimes there isn't. If its not there I need to add it, but if it there and I try to add it i get an error. Anyone know how to do an if statement around something like this. Thanks, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test for the existence of a worksheet? | Excel Programming | |||
Test for file existence | Excel Programming | |||
Existence, Search, Test | Excel Programming | |||
Test for existence of Name | Excel Programming | |||
how do i test for the existence of a range name | Excel Programming |