Excel Tutorials | Macros Code

Use Goal Seek

Sub GoalSeekVBA() Dim Target As Long On Error GoTo Errorhandler Target = InputBox(“Enter the required value”, “Enter Value”) Worksheets(“Goal_Seek”).Activate With ActiveSheet.Range(“C7”) .GoalSeek_ Goal:=Target, _ ChangingCell:=Range(“C2”)

Read More »

VBA Code to Search on Google

Sub SearchWindow32() Dim chromePath As String Dim search_string As String Dim query As String query = InputBox(“Enter here your search here”, “Google Search”) search_string =

Read More »

Insert a Linked Picture

Sub LinkedPicture() Selection.Copy ActiveSheet.Pictures.Paste(Link:=True).Select End Sub How to Insert a Linked Picture using VBA macro code This VBA code will convert your selected range into

Read More »

Convert Range into an Image

Sub PasteAsPicture() Application.CutCopyMode = False Selection.Copy ActiveSheet.Pictures.Paste.Select End Sub How to Convert Range into an Image through VBA macro code? Paste selected range as an

Read More »

Create a Table of Content

Sub TableofContent() Dim i As Long On Error Resume Next Application.DisplayAlerts = False Worksheets(“Table of Content”).Delete Application.DisplayAlerts = True On Error GoTo 0 ThisWorkbook.Sheets.Add Before:=ThisWorkbook.Worksheets(1)

Read More »

Save Selected Range as a PDF

Sub HideSubtotals() Dim pt As PivotTable Dim pf As PivotField On Error Resume Next Set pt = ActiveSheet.PivotTables(ActiveCell.PivotTable.name) If pt Is Nothing Then MsgBox “You

Read More »