+ Reply to Thread
Results 1 to 6 of 6

Delete Shape and Row

  1. #1
    Registered User
    Join Date
    05-18-2010
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    2

    Delete Shape and Row

    Hi all...

    First post here, so I hope someone can help me out.

    I essentially have a button called "Remove" which I would like to delete the row it's on. I have figured out how to delete the button on click but can't get the click of this button to also delete the row of data. It's driving me up the wall.

    Any help?

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Delete Shape and Row

    Does the button name or caption somehow identify which row it is on?
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    05-18-2010
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Delete Shape and Row

    Dave,
    The button does not identify the row. I have simply added it next to the last piece of data on the row.

    I have an additional "Insert" button that creates a new line and copies a preformatted dataset including a new "Remove" button.

    Thanks

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Delete Shape and Row

    When you add the Remove button, what name do you give it? It may be possible to add a suffix to the end indicating the row number. You could then use that suffix to delete that row. Could you post the code that runs when you click the "Insert" button?

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Delete Shape and Row

    to remove the last row

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150

    Re: Delete Shape and Row

    Shape objects expose a couple of methods such as TopLeftCell and BottomRightCell. You can use one or the other or both to determine the range that contains (or intersects) the shape. What type of button have you drawn out? ActiveX from the ControlToolbox? A forms button? A shape from the drawing commandbar? It does not really matter as all of these different types of objects can be referenced by the shape class but it does matter in how we might go about getting a reference to the button itself. Are you able to upload an example here???

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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