+ Reply to Thread
Results 1 to 10 of 10

Copy A&B, Delete Row, Insert Date

  1. #1
    Registered User
    Join Date
    04-30-2015
    Location
    Oregon, USA
    MS-Off Ver
    2010
    Posts
    50

    Question Copy A&B, Delete Row, Insert Date

    Hi, Again!
    I'm working on a code to automate the long and boring process of archiving destroyed files.
    My current code works perfectly other than one thing, when the code copies the row to the "destroyed" sheet I need it to also insert today's date
    in column D of the row its copying the data to, And I can't seem to get that right.
    How should I go about this?
    Here's my code
    Please Login or Register  to view this content.
    Thanks for any help!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy A&B, Delete Row, Insert Date

    Hi,

    Maybe immediately after the .Copy instruction
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-30-2015
    Location
    Oregon, USA
    MS-Off Ver
    2010
    Posts
    50

    Re: Copy A&B, Delete Row, Insert Date

    Thanks, Works great! I couldn't get it to skip blank cells when I tried myself

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy A&B, Delete Row, Insert Date

    Glad to have assisted and thanks for the rep.

  5. #5
    Registered User
    Join Date
    04-30-2015
    Location
    Oregon, USA
    MS-Off Ver
    2010
    Posts
    50

    Re: Copy A&B, Delete Row, Insert Date

    Quote Originally Posted by Richard Buttrey View Post
    Glad to have assisted and thanks for the rep.
    Actually i've run into an error
    I added a bit of code so that it would delete the whole row including hidden columns instead of ignoring them, and it seems it only copies relative to the selection.
    For example;
    if i had a case number selected, rather than the name (in that same row) it would copy the case number and the cell next to it rather than the cells in columns A and B
    (though, I don't know if this was an error before i added the column hiding / unhiding)
    Any idea why?
    Current code;
    Please Login or Register  to view this content.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy A&B, Delete Row, Insert Date

    Hi,

    I find it difficult to understand what you mean without seeing your actual workbook and knowing exactly what you are doing when you encounter the problem. Please upload.

  7. #7
    Registered User
    Join Date
    04-30-2015
    Location
    Oregon, USA
    MS-Off Ver
    2010
    Posts
    50

    Re: Copy A&B, Delete Row, Insert Date

    Sorry for the REALLY late reply, but I've just returned to the office.

    Heres an example worksheet; the button im working on is the "destroyed" button.
    Example Doc.xlsm

    Thanks for the help!

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy A&B, Delete Row, Insert Date

    Change the With line to

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    04-30-2015
    Location
    Oregon, USA
    MS-Off Ver
    2010
    Posts
    50

    Re: Copy A&B, Delete Row, Insert Date

    Problem solved, thanks again, Richard!

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Copy A&B, Delete Row, Insert Date

    Glad to have helped and thanks for the rep.

+ 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: 10-05-2014, 12:28 PM
  2. Insert Rows between unlkike cells, copy paste, then delete
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2013, 02:13 PM
  3. Macro to Copy Values, Insert Row, Paste in Another, Delete Original Data
    By JimPDX in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 05:35 AM
  4. Reorder Rows (Manual Sort), Copy, Insert, Delete Row
    By Orada in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-17-2011, 03:32 PM
  5. Filter/Delete.Rows then Copy New Data and Insert xldown
    By exc4libur in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2011, 06:36 PM
  6. Delete Row + insert new Row and copy formula
    By kumaramitoujjain in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2010, 04:32 AM
  7. Insert row, copy formula, delete values
    By inky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2008, 11:58 PM

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