+ Reply to Thread
Results 1 to 4 of 4

Copy and Paste after delete - to maintain total number of rows

  1. #1
    Registered User
    Join Date
    10-09-2017
    Location
    Stavanger, Norway
    MS-Off Ver
    O365
    Posts
    78

    Copy and Paste after delete - to maintain total number of rows

    A simple problem but my VBA skills are limited.
    I have a USERFORM that adds rows to a list of data in a WORRKSHEET called ANALYSISDB. Data is added into columns A to O. I have a code to delete an entry, this deletes the entire row. BUT I have formulas in columns P to AI that refer to the data in columns A to O.

    The Workbook is too big to attach to this thread but I've enclose a picture of the Woorksheet

    I wish to maintain the overall number of rows to 301 rows (1 row of headers) and copy the formulas in column P to AI into the deleted rows at the bottom of the list. I suspect I can add code to the DELETE action that will perform a copy and paste. Not using VBA I would select the last row of data in Column P to AI and drag the contents down to Rows 301.
    The Code I'm using for the DELETE actions is enclosed below
    a picture of th

    Please Login or Register  to view this content.
    Attached Images Attached Images

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Copy and Paste after delete - to maintain total number of rows

    Instead of deleting the entire row...
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-09-2017
    Location
    Stavanger, Norway
    MS-Off Ver
    O365
    Posts
    78

    Re: Copy and Paste after delete - to maintain total number of rows

    A very logical solution to the problem, why didn't I think of that... what does the ".Resize" action actually mean. I'm low on VBA coding skills, but getting up the learning curve
    Simon

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: Copy and Paste after delete - to maintain total number of rows

    It allows you to change the size of a range, in this case from 1 column to 15 columns.

    https://docs.microsoft.com/en-us/off...l.range.resize

+ 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. Replies: 1
    Last Post: 01-07-2019, 10:54 AM
  2. Copy, transpose paste, and delete rows macro
    By johnjoepaddyfrancie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2017, 08:58 AM
  3. [SOLVED] Copy Cell to all available rows below and delete total lines
    By Rookie2016 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2016, 11:13 AM
  4. [SOLVED] Delete every nth rows which is dependent on total number of rows
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2013, 02:14 AM
  5. [SOLVED] Copy paste and delete some cell then repeat until all rows are done
    By Greaser2k in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-15-2012, 01:21 AM
  6. [SOLVED] Cut, Copy, Paste & Delete Rows If Value Does Not Exist
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2011, 03:41 AM
  7. Need to Fin Last Row then copy / paste previous 6 rows and delete data
    By dwalton5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2011, 01:16 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