Showing posts with label Delete all charts on worksheet using VBA. Show all posts
Showing posts with label Delete all charts on worksheet using VBA. Show all posts

Saturday, January 19, 2013

Delete all charts on worksheet using VBA

If you want to delete all the charts on the worksheet.Try this macro



Sub delete_all_chats()

Dim shp  As Shape

' change sheet name here
For Each shp In Sheets("sheet2").Shapes
    If shp.Type = msoChart Then
        shp.Delete
    End If
Next

End Sub


Import data from SQL

Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...