+ Reply to Thread
Results 1 to 4 of 4

Help with moving data to an archive sheet

  1. #1
    Registered User
    Join Date
    09-15-2020
    Location
    IL
    MS-Off Ver
    16
    Posts
    14

    Help with moving data to an archive sheet

    Hi all,

    First, thanks for the help, I really appreciate all you EXCEL pros for taking the time to help us Noobs. I have is pieced together a bit of code to move data from one sheet to another when a certain condition is met. I have two sheets in the same workbook, one TEST sheet and one ARC DATA sheet. The code i used moves data from the TEST sheet to the ARC DATA sheet when a "Y" is present in a specified column (column P) and I press a button. The problem I am having is that when the data is copied over to the ARC DATA sheet it also copies any formulas I have in the cells. Also, i don't know if this modified formula is the most efficient coding for the job. any help would be great, i have included an example workbook.


    I would like to move just the cell data and not any codes within the cells.


    Here is a copy of the current code I am using for the command button to move data:

    Private Sub CommandButton1_Click()
    Dim r As Long, lr As Long
    r = 2
    lr = Cells(Rows.Count, 1).End(xlUp).Row
    Do Until r = lr + 20
    If Cells(r, 16) = "y" Then
    Range(Cells(r, 1), Cells(r, 11)).Copy
    Worksheets("ARC DATA").Select
    erow = Worksheets("ARC DATA").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

    ActiveSheet.Paste Destination:=Worksheets("ARC DATA").Rows(erow)
    End If
    r = r + 1
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Help with moving data to an archive sheet

    Try this code instead of your current code

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-15-2020
    Location
    IL
    MS-Off Ver
    16
    Posts
    14

    Re: Help with moving data to an archive sheet

    Thank You, the code works great. I do have one other question. Is there a way that once i push the button that it will take me to the ARC DATA page to verify the data has been transferred.

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Help with moving data to an archive sheet

    This updated code will do that for you

    Please Login or Register  to view this content.

+ 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. archive data to another sheet with only value and format
    By franckikoyi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2019, 11:32 AM
  2. Macro/VBA to Auto Archive data to new sheet
    By BooBoo14 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2018, 04:53 PM
  3. Auto Archive rows to separate sheet but retain data validation in original sheet
    By chrisk67 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2016, 10:27 PM
  4. [SOLVED] Moving Emails from Folder to Public Archive
    By Anxiety in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2016, 11:29 AM
  5. [SOLVED] Need a macro to copy dates & data from one sheet to an updating archive sheet
    By pbj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2013, 06:58 PM
  6. [SOLVED] Moving a row to archive sheet
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2012, 10:43 AM
  7. Moving Files to Archive - Preserving Links
    By Hillheader in forum Excel General
    Replies: 0
    Last Post: 03-19-2007, 06:15 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