Showing posts with label Macro to delete shapes on Activesheet. Show all posts
Showing posts with label Macro to delete shapes on Activesheet. Show all posts

Wednesday, July 7, 2010

Macro to delete shapes on Activesheet

If you want to delete all the shapes on active sheet  in one go .Try this macro



Sub delete_shapes()

Dim sh As Shape

For Each sh In activesheet.Shapes
     If sh.Type = msoPicture Then
            sh.Delete
     End If
Next sh

End Sub




Steps to Use


  • Copy the below code
  • Press Alt+F11 to open VBA editor
  • Paste it in any public module or module 1
  • Run the macro

Import data from SQL

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