Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default find sheet from list.

Hi All

I'm not sure if this is possible or not, but heres what I would like to do.

In a sheet called names in column A I have a list of sheet names.

I would like a macro to find the sheet that corresponds to the cell value
and perform a macro.

And then go onto the next cell in the list, and perform the same macro

as the list varies from month to month, and doesn't include the same names
each month I only want to perform the macro on names that exist.

Any help greatly appreciated

Cheers

Andy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default find sheet from list.

Assume sheet with list of names and the named sheets are in the same
workbook.

Dim sh as Worksheet
Dim cell as Range
for each cell in Range("A1:A10")
set sh = Nothing
on Error resume next
set sh = Worksheets(cell.Value)
On Error goto 0
if not sh is nothing then
sh.Activate
' call macro
end if
Next

--
Regards,
Tom Ogilvy

Andy Healey wrote in message
...
Hi All

I'm not sure if this is possible or not, but heres what I would like to

do.

In a sheet called names in column A I have a list of sheet names.

I would like a macro to find the sheet that corresponds to the cell value
and perform a macro.

And then go onto the next cell in the list, and perform the same macro

as the list varies from month to month, and doesn't include the same names
each month I only want to perform the macro on names that exist.

Any help greatly appreciated

Cheers

Andy




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default find sheet from list.

Hi Tom

It works an absolute dream, thanks a lot

cheers

Andy
"Tom Ogilvy" wrote in message
...
Assume sheet with list of names and the named sheets are in the same
workbook.

Dim sh as Worksheet
Dim cell as Range
for each cell in Range("A1:A10")
set sh = Nothing
on Error resume next
set sh = Worksheets(cell.Value)
On Error goto 0
if not sh is nothing then
sh.Activate
' call macro
end if
Next

--
Regards,
Tom Ogilvy

Andy Healey wrote in message
...
Hi All

I'm not sure if this is possible or not, but heres what I would like to

do.

In a sheet called names in column A I have a list of sheet names.

I would like a macro to find the sheet that corresponds to the cell

value
and perform a macro.

And then go onto the next cell in the list, and perform the same macro

as the list varies from month to month, and doesn't include the same

names
each month I only want to perform the macro on names that exist.

Any help greatly appreciated

Cheers

Andy






Reply
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
How can I find data in one list and add it to another sheet? soconfused Excel Worksheet Functions 3 June 17th 09 04:38 PM
Find name in list and get dept # enter dept # on work sheet Jamba Excel Worksheet Functions 1 April 30th 06 11:39 PM
How to find a find a list of possible inputs to sum a known amt? JimBunch Excel Discussion (Misc queries) 2 February 18th 06 05:17 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
sort list of players by team from player list on separate sheet Robert Excel Worksheet Functions 1 July 19th 05 01:57 AM


All times are GMT +1. The time now is 04:39 PM.

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

About Us

"It's about Microsoft Excel"