Testing for chart in a worksheet
Hello,
I have a program that will allow me to input data on many sheets, in my workbook, from various testing that I do in a our lab. The program has a cmdbutton which executes a macro to generate an MSWord document. The macro cycles through each sheet in the activeworkbook and pulls data from cells and writes it to the Word application. As the macro cycles through each sheet I want it to check if there's a chart on that sheet and if so select and copy it to the Word document. Is that possible somewhere in VBA?? Thanks, Matt |
Testing for chart in a worksheet
Hi Matt,
Have a look at the ChartObject Msgbox "Activesheet contains " & _ Activesheet.ChartObjects.count & " charts" Cheers Andy MBaars wrote: Hello, I have a program that will allow me to input data on many sheets, in my workbook, from various testing that I do in a our lab. The program has a cmdbutton which executes a macro to generate an MSWord document. The macro cycles through each sheet in the activeworkbook and pulls data from cells and writes it to the Word application. As the macro cycles through each sheet I want it to check if there's a chart on that sheet and if so select and copy it to the Word document. Is that possible somewhere in VBA?? Thanks, Matt -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Testing for chart in a worksheet
Thanks Andy. I appreciate it.
Matt "Andy Pope" wrote: Hi Matt, Have a look at the ChartObject Msgbox "Activesheet contains " & _ Activesheet.ChartObjects.count & " charts" Cheers Andy MBaars wrote: Hello, I have a program that will allow me to input data on many sheets, in my workbook, from various testing that I do in a our lab. The program has a cmdbutton which executes a macro to generate an MSWord document. The macro cycles through each sheet in the activeworkbook and pulls data from cells and writes it to the Word application. As the macro cycles through each sheet I want it to check if there's a chart on that sheet and if so select and copy it to the Word document. Is that possible somewhere in VBA?? Thanks, Matt -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
All times are GMT +1. The time now is 10:57 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com