LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Checking Active Sheet is in an approved list

Another way:

dim myNames as variant
dim res as variant

mynames = Array("Addis ETB", "Addis USD", "Geneva USD", _
"HSBC Cards", "London GBP", "London USD", "Hong Kong HKD", "Hong Kong USD")

res = application.match(activesheet.name,mynames,0)

if iserror(res) then
'not found
else
'found
end if




Matt wrote:

Hi Guys

I want my code to make a descion depending on whether or not the active
sheet is in an approved list.

I thought I would use an array for this as below

If ActiveSheet.Name = Array("Addis ETB", "Addis USD", "Geneva USD", _
"HSBC Cards", "London GBP", "London USD", "Hong Kong HKD", "Hong Kong USD")
Then

But obviously my syntax is wrong. If someone could help with the syntax or
let me know of a better way that would be fantastic.

Thanks for reading this far, and in advance for any help

Matt


--

Dave Peterson


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
list sheet names vertically below the active cell - need macro. Eddy Stan Excel Worksheet Functions 2 September 28th 07 07:48 PM
Macro to copy active sheet and email to distribution list bsnapool[_8_] Excel Programming 1 July 11th 06 07:19 PM
I need to sort an active sheet using the col of the active cell HamFlyer Excel Programming 3 June 6th 06 07:25 PM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM
Help sending active sheet to email list Kingtriotn Excel Programming 5 January 18th 04 10:43 AM


All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"