Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
verify if spesific sheet exist
hi,
i created a macro.... i need to check if the active work book has a sheet named "xxx". do you know how should i do that? thanks in advance. -- Miri Tz. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
verify if spesific sheet exist
Try this which is case sensitive
Sub isthereanybodythere() Dim ws As Worksheet msg = "What sheet are you looking for" response = InputBox(msg) For Each ws In ActiveWorkbook.Worksheets Name = ws.Name Worksheets(Name).Select If response = Name Then msg = Name + " Sheet exists" MsgBox (msg) End If Next ws End Sub "Miri" wrote: hi, i created a macro.... i need to check if the active work book has a sheet named "xxx". do you know how should i do that? thanks in advance. -- Miri Tz. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
verify if spesific sheet exist
"Miri" wrote: hi, i created a macro.... i need to check if the active work book has a sheet named "xxx". do you know how should i do that? thanks in advance. -- Miri Tz. Hi , You could write a macro like the one shown below Sub Surch() a = Inputbox("Enter the name of the worksheet you want to search for:") For each ws in worksheets ws.select If activesheet.name = a then Msgbox ("This workbook has a sheet named " & a) Goto last Endif Next last:End Sub This will do the trick VJ |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
verify if spesific sheet exist
One mo
dim testWks as worksheet set testwks = nothing on error resume next set testwks = activeworkbook.worksheets("xxx") on error goto 0 if testwks is nothing then 'doesn't exist else 'yep, it's there end if Miri wrote: hi, i created a macro.... i need to check if the active work book has a sheet named "xxx". do you know how should i do that? thanks in advance. -- Miri Tz. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Go to spesific letter in a list | Excel Discussion (Misc queries) | |||
How to get exact hours above a spesific time? | Excel Discussion (Misc queries) | |||
VBA: Make a new sheet if it doesn't exist | Excel Discussion (Misc queries) | |||
VBA, Make a new sheet if it doesn't exist | Excel Discussion (Misc queries) | |||
Verify if Comment exist in a cell | Excel Discussion (Misc queries) |