Excel - VBA Macro for Exact Chart Location and Size - Episode 1291

Excel - VBA Macro for Exact Chart Location and Size - Episode 1291

Microsoft Excel Tutorial: Easy VBA Macro to control the exact location of your Chart by designating its placement on your worksheet. Welcome to the MrExcel podcast. In this episode, we will be diving into Chapter 11 of the VBA and Macros book, focusing on charting. There are many charting macros to explore, but for this podcast, we will be discussing how to control the location of a chart. To begin, I will demonstrate how to create a chart using the Developer tab and the Record Macro feature. Once the chart is created, we will take a closer look at the recorded macro and the Add Chart method. This method allows us to select the chart and make changes to it. However, there is a potential issue with using the top-left width and height method, as it relies on specific pixel measurements that can easily be altered by adjusting column widths or row heights. To avoid this issue, I will show you an alternative method in module 3. Instead of using specific pixel measurements, we will use the range of cells where the chart will be located. This way, the macro will always adjust to the correct location, even if the spreadsheet is altered. This is a much safer and more efficient way to control the location of a chart. By using this method, we can ensure that the chart will always appear in the correct location, no matter what changes are made to the spreadsheet. This is a valuable trick to have in your VBA and Macros toolkit. Thank you for tuning in to this episode of the MrExcel podcast. Be sure to join us next time for more helpful tips and tricks. Buy Bill Jelen's latest Excel book: https://www.mrexcel.com/products/latest/ You can help my channel by clicking Like or commenting below: https://www.mrexcel.com/like-mrexcel-... Table of Contents: (00:00) Excel VBA, Chart Location (00:12) Creating a Chart Macro (00:28) Controlling Chart Location with Add Chart Method (01:05) Alternative Code for Controlling Chart Location (02:00) Using Cell References for Chart Location (03:03) Benefits of Using Cell References (03:37) Clicking Like really helps the algorithm #excel #microsoft #microsoftexcel #exceltutorial #exceltips #exceltricks #excelmvp #freeclass #freecourse #freeclasses #excelclasses #microsoftmvp #walkthrough #evergreen #spreadsheetskills #analytics #analysis #dataanalysis #dataanalytics #mrexcel #spreadsheets #spreadsheet #excelhelp #accounting #tutorial This video answers these common search terms: Add Chart method Chapter 11 Chart location Danger of hard-coding chart position Developer tab Dynamic chart placement Excel VBA Record Macro Top-left width and height Using range references for chart location Join the MrExcel Message Board discussion about this video at https://www.mrexcel.com/board/threads...