+ Reply to Thread
Results 1 to 2 of 2

Deleted rows and add to another sheet

  1. #1
    Forum Contributor
    Join Date
    03-23-2011
    Location
    Ormesby
    MS-Off Ver
    Microsoft 365 MSO
    Posts
    130

    Deleted rows and add to another sheet

    Hello all,

    I have a sheet, that each time I add the No8 to Cell D, then click on the Delete Rows button, the entire Row is deleted.

    What I require now, is when the Deleted Rows button is pressed, the row is removed from that sheet but is saved to another sheet.

    This is the code I have to delete the Rows
    Can you help with the update, so the Deleted Rows will be saved to another sheet.

    Private Sub CommandButton1_Click()
    With Sheets("Activity Rows Deleted")
    LastP = .Range("D" & Rows.Count).End(xlUp).Row
    Application.ScreenUpdating = False
    For r = LastP To 2 Step -1
    If .Cells(r, "D") = 8 Then .Cells(r, "D").EntireRow.Delete
    Next r
    End With
    Application.ScreenUpdating = True
    End Sub

    Many thanks

    Pugg

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Deleted rows and add to another sheet

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Google Sheet: Rows are randomly being deleted (disappearing)
    By Vaune in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 11-25-2021, 10:07 AM
  2. [SOLVED] Rows are being deleted, but not pasting to appropriate sheet
    By sniper1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2020, 07:05 PM
  3. [SOLVED] code to auto number rows - that will update when rows are added/deleted
    By dkitzerow in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-12-2015, 10:45 AM
  4. Button on Sheet Disapears when columns or Rows are deleted
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2015, 04:20 PM
  5. update target sheet with rows as they are added or deleted to master sheet
    By RLR31064 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2014, 05:41 PM
  6. Replies: 6
    Last Post: 08-18-2012, 05:00 AM
  7. Replies: 8
    Last Post: 02-27-2009, 07:38 AM

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