Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I find data in one list and add it to another sheet? | Excel Worksheet Functions | |||
Find name in list and get dept # enter dept # on work sheet | Excel Worksheet Functions | |||
How to find a find a list of possible inputs to sum a known amt? | Excel Discussion (Misc queries) | |||
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 | Excel Worksheet Functions | |||
sort list of players by team from player list on separate sheet | Excel Worksheet Functions |