Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

find Sheet but sheet name not known

sounds crazy but.

Can an expert help me out with vba code that will look into the sheets in my workbook and find GLOBAL RATES in cell A1

when it finds that I need to copy the sheet and copy it to a new sheet in a different workbook.

I am using the below code to do copy sheets to different workbooks

Sheets("Sheet Name").Copy After:=Workbooks("Weekly Metrics Template.xlsx").Sheets("Sheet Name")

many thanks
Avatar of [ fanpages ]
[ fanpages ]

Will there be more than one worksheet with "GLOBAL RATES" in cell [A1]?

If so, do you want every matching worksheet to be copied or, perhaps, just the first located & then the searching stops?

Will "Weekly Metrics Template.xlsx" be open concurrently with the workbook that is executing the code required to search/copy the worksheet?
Avatar of Jagwarman

ASKER

hi Fan pages,

Will there be more than one worksheet with "GLOBAL RATES" in cell [A1]?

No there will only be one

Will "Weekly Metrics Template.xlsx" be open concurrently with the workbook that is executing the code required to search/copy the worksheet?

Yes it will
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Jagwarman.

Ryan has already progressed making those assumptions, so I do not think I need to provide a suggestion.

PS. Just an afterthought; will any worksheets be Hidden (/VeryHidden)?  If so, should they be ignored?
That's perfect Thank you both