Excel Tutorials | Macros Code

Add Chart Title

Sub AddChartTitle() Dim i As Variant i = InputBox(“Please enter your chart title”, “Chart Title”) On Error GoTo Last ActiveChart.SetElement (msoElementChartTitleAboveChart) ActiveChart.ChartTitle.Text = i Last:

Read More »

Paste Chart as an Image

Sub ConvertChartToPicture() ActiveChart.ChartArea.Copy ActiveSheet.Range(“A1”).Select ActiveSheet.Pictures.Paste.Select End Sub Paste Chart as an Image VBA code: This code will help you to convert your chart into an

Read More »

Change Chart Type

Sub ChangeChartType() ActiveChart.ChartType = xlColumnClustered End Sub This code will help you to convert chart type without using chart options from the tab. All you

Read More »

Disable/Enable Get Pivot Data

Sub activateGetPivotData() Application.GenerateGetPivotData = True End Sub Sub deactivateGetPivotData() Application.GenerateGetPivotData = False End Sub Get Pivot Data:  To disable/enable GetPivotData function you need to use

Read More »

Refresh All Pivot Tables

ub vba_referesh_all_pivots() Dim pt As PivotTable For Each pt In ActiveWorkbook.PivotTables pt.RefreshTable Next pt End Sub Refresh All Pivot Tables: A super quick method to

Read More »

Welcome Message

Sub auto_open() MsgBox _ “Welcome To xlsxtemplates & Thanks for downloading this file.” End Sub Welcome Message in excel macro code.  You can use auto_open

Read More »