Consulting

Results 1 to 3 of 3

Thread: Need to check if a picture exist or not then delete

  1. #1
    VBAX Contributor Daxton A.'s Avatar
    Joined
    Jun 2004
    Location
    Biloxi, Mississippi
    Posts
    143
    Location

    Need to check if a picture exist or not then delete

    For i = 1 To 1000
        If ActiveSheet.Shapes.Range(Array("Picture " & i)).Select = True Then
                Selection.Delete
        Else
        
        End If
    Next i
        
    End Sub
    “All right now ya wise guy … Dance!”

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I use
    Sub DelPics()
    Dim shp As Shape
    For Each shp In ActiveSheet.Shapes
    If Left(shp.Name, 3) = "Pic" Then shp.Delete
    Next shp
    End Sub
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Contributor Daxton A.'s Avatar
    Joined
    Jun 2004
    Location
    Biloxi, Mississippi
    Posts
    143
    Location
    Works like a charm, Thanks!
    “All right now ya wise guy … Dance!”

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •