+ Reply to Thread
Results 1 to 4 of 4

Automaticaly cut rows and paste into another worksheet when conditions are met

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Tijuana Mexico
    MS-Off Ver
    Excel 2010
    Posts
    6

    Automaticaly cut rows and paste into another worksheet when conditions are met

    Basically I have a list of all my open po's in the "Open PO's" worksheet and when they are complete I manually copy them to either of the customers name for example "Mecano" tab and delete the row from "Open PO's". A job is completed when the value of that row in column N = 0.

    Can someone point me in the right direction of some VBA code that would do the following:

    1) Select a row(s) in "Open PO's" if the value in column B of the row reaches 0.
    2) Copy selected rows.
    3) Paste selected rows into correct customers name tab, example "Mecano" on the first blank row available and then every other blank row after that if there is more than one to do at a time.
    4) Delete the selected rows that were just copied in "Open PO's".

    I found a code on a similar thread posted a couple of years ago, however im not savy in VB or coding however I would like to see if this can be done this is the string of codes I saw also

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("N:N")) Is Nothing Then
    If Target.Count = 1 Then
    Dim RowNum As Integer

    If Target = 0 Then
    RowNum = Sheets("Completed").Range("A65536").End(xlUp).Row + 1
    Target.EntireRow.Copy Destination:=Sheets("Completed").Cells(RowNum, 1)
    Target.EntireRow.Delete
    End If
    End If
    End If

    End Sub

    Private Sub Worksheet_Calculate()

    Dim Cll As Range
    Dim RowNum As Integer

    For Each Cll In Sheets("JOBS ON HAND").Range("N1:N" & Range("A65536").End(xlUp).Row)
    If IsError(Cll) = False Then
    If Cll.Value = 0 Then
    RowNum = Sheets("COMPLETED").Range("A65536").End(xlUp).Row + 1
    Cll.EntireRow.Copy Destination:=Sheets("COMPLETED").Cells(RowNum, 1)
    Cll.EntireRow.Delete
    End If
    End If
    Next Cll

    End Sub

    The only thing is I don't know how to make it copy rows and paste it in specific customer tabs

    Thanks for your assistance.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Automaticaly cut rows and paste into another worksheet when conditions are met

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    02-20-2013
    Location
    Tijuana Mexico
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Automaticaly cut rows and paste into another worksheet when conditions are met

    It seems I can't attach the file

  4. #4
    Registered User
    Join Date
    08-02-2013
    Location
    NYS
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Automaticaly cut rows and paste into another worksheet when conditions are met

    Supplier.xlsx

    I am having a similar issue. I'd like to avoid using VB, if possible just a formula.
    I have a spreadsheet with multiple tabs. One is a Summary tab, the remaining are Suppliers (and a data tab for Vlookup).

    On the Summary Page, what I'd like it to do is if Column C has "Supplier A" then it copies that Entire row of data to the Supplier A's tab...and so on for
    Supplier B, C, etc. I (sort of) got there with this: =IF(SUMMARY!$H4='Supplier A'!$A$1,SUMMARY!A$4,"")

    The only problem is that when it copies the rows, I end up with blank lines on each Supplier's tab because it doesn't see Supplier A, etc.
    Is there a way to do what I'm doing without the ,"") at the end...or to tell it to skip those like where the lookup isn't valid and go to the next valid row?

+ 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. Cut and Paste Rows when conditions are met
    By Synflame in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2012, 07:53 AM
  2. Replies: 0
    Last Post: 10-16-2012, 03:50 AM
  3. Copy & Paste with set conditions and count of rows
    By dnyhof in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-12-2011, 11:29 AM
  4. automaticaly copy cell data meeting certain conditions to separate worksheet
    By marc eber in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2008, 05:47 PM
  5. automaticaly sort selected contents on worksheet to seperate worksheet
    By fuadramsey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-17-2007, 09:16 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