find sheet from list.

  • Thread starter Thread starter Andy Healey
  • Start date Start date
A

Andy Healey

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
 
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
 
Back
Top