+ Reply to Thread
Results 1 to 8 of 8

Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

  1. #1
    Registered User
    Join Date
    12-06-2006
    Location
    California
    MS-Off Ver
    2003
    Posts
    5

    Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    Hello there! Avid user of this forum, but never posted. Please help me out!

    Heres the situation:
    --> User makes a selection to change Cell S in Row 26 (for example) to a "4" or "Completed"
    --> Conditional values are set to turn the entire row Grey so the user knows the item is complete but not archived
    --> Make a button (macro) to find all values in column S that are labeled "4" and move the entire row to a tab labeled "Archive"
    --> Delete the row when finished
    --> Have this work for multiple rows that may all be complete at the same time, but not archived yet

    I tried a few If-Then statements, but they archive the data immediately. I want the user to be able to archive the data when they are ready.

    ???

    Thank you in advance!

    Cainamogel82

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    A few question and observations...

    1) have you got the macro created? I think you have but a bit confusing...
    2) Is it in the worksheet sub or a stand alone macro?
    3) Can you upload the file without any company confidential info?

    thanks
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    12-06-2006
    Location
    California
    MS-Off Ver
    2003
    Posts
    5

    Re: Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    1) This code works for another user with Cars and the Sold/Repaired macro. I can't get it to work in my book, but I also do not want the values to automatically move over, I want them only to move once the user selects the button.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 18 And Target.Value = "4" Then
    Target.EntireRow.Copy Worksheets("Archive").Range("A" & Rows.Count).End(xlUp).Offset(1)
    Target.EntireRow.Delete
    End If
    End Sub

    2) It is in something labeled "Module 4"...not quite sure if that makes it unuseable.

    3) I can make it available, but I would need to erase quite a bit. If the info above doesn't help, then I can work on creating a non-confidential copy.

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    What doesn't work on the macro from the one that works with Cars/Sold/Repaired?

  5. #5
    Registered User
    Join Date
    12-06-2006
    Location
    California
    MS-Off Ver
    2003
    Posts
    5

    Re: Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    I don't know, I was hoping to keep it simple...

    However, in starting this thread, another thread popped up and it seems to have given me the code that works:

    Sub UpdateCompleted()

    Dim LastRowCompleted As Single, LastRow As Single, x As Single

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False

    LastRowCompleted = Sheets("Archive").Cells(65000, 2).End(xlUp).Row
    LastRow = Cells(65000, 2).End(xlUp).Row

    For x = 26 To LastRow
    If Cells(x, 18).Value = "4" Then
    Range("A" & x & ":T" & x).Select
    Selection.Copy
    Sheets("Archive").Select
    Range("A" & LastRowCompleted + 1).Select
    ActiveSheet.Paste
    LastRowCompleted = Sheets("Archive").Cells(65000, 2).End(xlUp).Row
    Sheets("Open").Select
    Rows(x & ":" & x).Select
    Selection.Delete Shift:=xlUp
    End If
    Next x

    Application.ScreenUpdating = True
    Application.DisplayAlerts = True

    End Sub

    So, I think I solved my problem (or basically, this thread solved my problem: http://www.excelforum.com/excel-prog...ro-button.html)

    Thank you!

    Cainamogel82

  6. #6
    Registered User
    Join Date
    12-06-2006
    Location
    California
    MS-Off Ver
    2003
    Posts
    5

    Re: Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    Which...I just noticed is also you.

    Okay...I'll give you a thumb dude, thank you!

  7. #7
    Registered User
    Join Date
    12-06-2006
    Location
    California
    MS-Off Ver
    2003
    Posts
    5

    Re: Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    And also noticed I can't give you good reputation multiple time sin a short period...

    Reputation.jpg

  8. #8
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Move data (completed row) from one row on Tab 1 to Tab 2 using a macro

    thanks....glad I could help from the past....thanks for the rep points....please don't forget to set this thread to Solved....

+ 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. Move completed items to second worksheet using macro button
    By leo.cuzmar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2013, 04:33 PM
  2. Move completed data from one worksheet to next blank row of another
    By Loisw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2013, 11:26 AM
  3. Move Completed Items to a new worksheet.
    By Linzela42300 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2013, 01:48 PM
  4. Move entire row of data from Sheet 1 to sheet 2 when completed date is entered.
    By jt7721 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2013, 11:50 AM
  5. [SOLVED] Move a row to another sheet after status says completed
    By rjclampitt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2012, 06:32 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