+ Reply to Thread
Results 1 to 3 of 3

Deleting Shapes from an Active Cell then clear the contents ??

  1. #1
    Registered User
    Join Date
    12-26-2016
    Location
    London, England
    MS-Off Ver
    365
    Posts
    79

    Deleting Shapes from an Active Cell then clear the contents ??

    Hi I have a sheet that contains shapes in a number of cells (sometimes more than one shape per cell)

    I need VBA code to clear all the shapes from 'ONLY' the active cell and then clear the contents of that active cell.

    The code I am trying is below - But get a debug error on "For Each Shp In ActiveCell.Shapes"

    Not sure what I am doing wrong?

    Sub DeleteShapes_ActiveCell()

    Dim Shp As Shape

    For Each Shp In ActiveCell.Shapes
    If Shp.ActiveCell = ActiveCell Then Shp.Delete
    ActiveCell = ""
    Next Shp
    ActiveCell.ClearContents
    Range("c3").Select

    End Sub

  2. #2
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Deleting Shapes from an Active Cell then clear the contents ??

    I think this will do what you are asking
    Please Login or Register  to view this content.
    And for future posting please make sure to use the code tags around your macro ( it’s the thing on the posting tool bar that looks like this # )
    Bramz

  3. #3
    Registered User
    Join Date
    12-26-2016
    Location
    London, England
    MS-Off Ver
    365
    Posts
    79

    Re: Deleting Shapes from an Active Cell then clear the contents ??

    Thanks a lot !!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Needing VBA code to clear contents of cell when the contents of another cell is cleared
    By jeh0714 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2016, 03:49 PM
  2. [SOLVED] Moving shapes to the middle left of an active cell
    By biznez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2016, 10:50 AM
  3. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  4. [SOLVED] vba to clear contents in specific ranges on active sheet
    By blackburnsexcel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2014, 09:35 AM
  5. [SOLVED] Clear contents based on contents of another cell
    By Katrina DTE in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2013, 02:44 PM
  6. Macro is deleting sheet, and I would like it to clear contents
    By stevewilk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-09-2009, 06:05 PM
  7. How to set the position of a active cell and clear the contents of the cells
    By aijihz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2007, 04:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1