+ Reply to Thread
Results 1 to 15 of 15

Looking to implement Archive button with table data - need help!

  1. #1
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8

    Post Looking to implement Archive button with table data - need help!

    Basically I just need to have a button to archive completed entries to another table on another sheet.

    Criteria: Table rows with "COMPLETE" in cell under Table Header "ARCHIVE"

    From: Worksheet "ORDERS_LIST" / Table "ORDERS_TB"
    Destination: Worksheet "ARCHIVE" / Table "ARCHIVE_TB"

    Then delete row from "ORDERS_TB"

    Of course needs to be able to add rows to table for the entries being archived.
    I dont know if it matters by a lot of the cells for ORGIN worksheet use conditional formatting for colors and dates.


    ***WISHLIST - Would be nice if automatically each new row had a checkbox in the Archive column and that activate the Archive Function.***


    File attached. Thanks for all the help.


    I have not got far, i have tried many things from other posts but im not seeming to grasp the whole thing properly. and have deleted most of my attempts. Im guessing i need to start the VBA with the definitions and set variables. MER.

    _______________________________________
    Sub ARCHIVE()
    Application.ScreenUpdating = False

    Dim OL As Worksheet
    Dim AL As Worksheet

    Set OL = Worksheets("ORDERS_LIST")
    Dim OLT As ListObject
    Set OLT = ws.ListObjects("ORDERS_TB")

    Set AL = Worksheets("ARCHIVE")
    Dim ALT As ListObject
    Set ALT = ws.ListObjects("ARCHIVE_TB")

    End Sub
    _______________________________________
    Attached Files Attached Files
    Last edited by stipple; 09-11-2020 at 12:52 PM.

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Looking to implement Archive button with table data - need help!

    Hi stipple & welcome to the forum

    Try below code on a sample file ...
    Please Login or Register  to view this content.
    PS: Please take a moment & edit your post, select your code then click the # button to insert the code tags
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8

    Re: Looking to implement Archive button with table data - need help!

    That works great! Thanks!

    Now how can I make this line more dynamic. Like table related.... instead of A:A

    .SpecialCells(12).Copy Sheets("ARCHIVE").Range("A:A").Find("*", LookIn:=xlValues, SearchDirection:=2).Offset(1)

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Looking to implement Archive button with table data - need help!

    I used the below line first but noticed that you have some blank rows in your table that's why I used an alternative method ... Not sure if there's another way but this pastes the data toward the end of the table

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8

    Re: Looking to implement Archive button with table data - need help!

    YEA I STILL ISSUES. darn. After more testing. It seems to be overwriting rows on archive sheet when you go past like 28. Or whatever.

  6. #6
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Looking to implement Archive button with table data - need help!

    Does the provided code in post #2 work as expected ?

  7. #7
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8
    Quote Originally Posted by nankw83 View Post
    Does the provided code in post #2 work as expected ?
    Nope that's doing the overwrite

  8. #8
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Looking to implement Archive button with table data - need help!

    Do you have rows where column A is blank & it is COMPLETED ?

    Edit: If it is possible to have blanks in column A, try to change .Range("A:A") to .Range("U:U")
    Last edited by nankw83; 09-11-2020 at 04:08 PM.

  9. #9
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8

    Re: Looking to implement Archive button with table data - need help!

    That will just start the paste at ROW "U"

  10. #10
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Looking to implement Archive button with table data - need help!

    Oops ! You're right, I guess I am getting sleepy ... It should be like below
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8

    Re: Looking to implement Archive button with table data - need help!

    So I am using that as I try and make a more dynamic version. Here's what i have so far. Need some redundancy checking or something.

    -Need a count function for Copied Rows.
    -Count destination columns and rows
    -Then to add Copied Row Value to destination table.
    -Then Paste Copied Rows in Added Rows
    -


    -Subtract that value from Copied count to know proper row was added. then to paste entries
    Please Login or Register  to view this content.

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

    Re: Looking to implement Archive button with table data - need help!

    try:

    .SpecialCells(12).Copy alt.ListRows.Add.Range

  13. #13
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Looking to implement Archive button with table data - need help!

    @stipple, does the updated code in post # 10 still have issues ? What happens exactly ? It is working ok for me ...

  14. #14
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8

    Re: Looking to implement Archive button with table data - need help!

    Quote Originally Posted by maniacb View Post
    try:

    .SpecialCells(12).Copy alt.ListRows.Add.Range

    Thanks So far your Line has fixed my Code. Thanks! Put it right at bottom of table. =)

  15. #15
    Registered User
    Join Date
    09-11-2020
    Location
    USA
    MS-Off Ver
    365
    Posts
    8

    Re: Looking to implement Archive button with table data - need help!

    Not sure why post #10 was doing it..... But for me it would paste over another row around row 26. or so. depending.
    Last edited by stipple; 09-12-2020 at 01:34 PM.

+ 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 database that is linked to an excel table.
    By Proud_Lyon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-12-2016, 06:27 PM
  2. Excel VBA Archive Monthly Account Returns to an Archive File
    By cmarenco in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2016, 10:12 PM
  3. How to implement what a Pivot Table can do but in a Formula
    By qlo_0lp in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-27-2015, 08:33 AM
  4. Need to Implement Data from Another Worksheet
    By Jaz3385 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-13-2013, 11:41 PM
  5. Live Pivot table and trying to archive data
    By Frasier433 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2012, 11:21 AM
  6. Implement a Pivot table
    By a.mack123 in forum Excel General
    Replies: 32
    Last Post: 10-25-2010, 08:24 AM

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