NeverHappyMike
Member
Hi
I've recorded myself copying a legend from my correct workbook (Mike1) into another one (OtherWorkbook) that I have opened. I'll be doing this process quite a few times so wanted to make a short macro to help me do this.
Unfortunately, the 'OtherWorkbook' name is very specific, and I can't figure out how to make it refer to any workbook that I have opened. There will only ever be two workbooks opened at a time.
Any help greatly appreciated.
Michael.
I've recorded myself copying a legend from my correct workbook (Mike1) into another one (OtherWorkbook) that I have opened. I'll be doing this process quite a few times so wanted to make a short macro to help me do this.
Unfortunately, the 'OtherWorkbook' name is very specific, and I can't figure out how to make it refer to any workbook that I have opened. There will only ever be two workbooks opened at a time.
Code:
Windows("Mike1.xlsx").Activate
ActiveSheet.Shapes.Range(Array("xlamLegendGroup")).Select
Selection.Copy
Windows("OtherWorkbook.xlsx").Activate
ActiveSheet.Shapes.Range(Array("xlamLegendGroup")).Select
ActiveSheet.Paste
Any help greatly appreciated.
Michael.