+ Reply to Thread
Results 1 to 9 of 9

Inserting and Deleting Rows & 3-D Summing

  1. #1
    Forum Contributor
    Join Date
    02-04-2011
    Location
    Cape Town
    MS-Off Ver
    MS 365 Apps for Business
    Posts
    111

    Inserting and Deleting Rows & 3-D Summing

    Hi Guys

    Could someone please assist me with two things, which I think will be simple for most, but not for me - Im fairly new at the VBA game but learning fast!

    Firstly. Im trying to record a macro that will add or delete rows in a spreadsheet. I have attached a sample spreadsheet. I would like to add/delete one row at a time at the bottom of the table before the total row. I have tried the recording macro method which is fairly straight forward. However, there is one provision when it comes to deleting - I must be able to delete all rows except for the top row (which I have highlighted in blue). This row will have formulas and if it is deleted, there will no longer be anything to copy when I do the add row macro. How do you prevent the delete row macro from deleting the top row?

    Secondly, Im trying to create a macro which will replicate the existing worksheet, but it must create the sheet in between the START and END sheets. Im using 3-D to sum and if I accidently create the sheet outside of those two, it wont 3-D sum. I also want the new sheet to automatically be called NEW PROPERTY each time I create it. I will rename the sheet immediately afterwards, but when I create it, it must have this name.

    I would appreciate it if someone could help
    Attached Files Attached Files
    Last edited by markvdh; 03-02-2011 at 06:26 AM. Reason: Sorry forgot the attachment

  2. #2
    Forum Contributor
    Join Date
    02-04-2011
    Location
    Cape Town
    MS-Off Ver
    MS 365 Apps for Business
    Posts
    111

    Re: Inserting and Deleting Rows & 3-D Summing

    Bump no response

  3. #3
    Forum Contributor
    Join Date
    02-04-2011
    Location
    Cape Town
    MS-Off Ver
    MS 365 Apps for Business
    Posts
    111

    Re: Inserting and Deleting Rows & 3-D Summing

    Bump no response

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Inserting and Deleting Rows & 3-D Summing

    hi, markvdh, will that go for a start? Run code "Add"
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Inserting and Deleting Rows & 3-D Summing

    here are all required codes:
    Add row
    Please Login or Register  to view this content.
    Delete row (starting from the end of the list)
    Please Login or Register  to view this content.
    New sheet named "NEW PROPERTY"
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by watersev; 03-01-2011 at 06:46 AM.

  6. #6
    Forum Contributor
    Join Date
    02-04-2011
    Location
    Cape Town
    MS-Off Ver
    MS 365 Apps for Business
    Posts
    111

    Re: Inserting and Deleting Rows & 3-D Summing

    Hi watersev. Thanks a bundle. I'll go through this when I have a bit more time this eveneing. I briefly had a look and it seems to work fine. Thank you. If I have any queries may I refer back to you?

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Inserting and Deleting Rows & 3-D Summing

    yes, markvdh, feel free. If you are happy with the result and there are no outstanding questions, please mark the thread as Solved (for details see Forum Rules).

  8. #8
    Forum Contributor
    Join Date
    02-04-2011
    Location
    Cape Town
    MS-Off Ver
    MS 365 Apps for Business
    Posts
    111

    Re: Inserting and Deleting Rows & 3-D Summing

    Hi watersev.
    Thanks. Ive been through the code as best I can. One or two requests. On 'add row', would it be possible to amend it to insert a row as well as copy the formula and formating from the row above to the new row? On 'new sheet', could it be amended to rename the new sheet "NEW PROPERTY" and add the number of the sheet. eg. NEW PROPERTY 1, then NEW PROPERTY 2, etc. The way I read it, this would also prevent the conflict? You've been very instructive to a new VBA learner, thank you

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Inserting and Deleting Rows & 3-D Summing

    please check attachment file
    Attached Files Attached Files

+ 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