+ Reply to Thread
Results 1 to 5 of 5

cut row based on cell value and paste in another worksheet

Hybrid View

bristorms cut row based on cell value... 04-09-2010, 12:42 PM
JBeaucaire Re: cut row based on cell... 04-09-2010, 12:59 PM
bristorms Re: cut row based on cell... 04-09-2010, 01:39 PM
twhitezell Re: cut row based on cell... 04-09-2010, 01:52 PM
JBeaucaire Re: cut row based on cell... 04-09-2010, 02:57 PM
  1. #1
    Registered User
    Join Date
    04-09-2010
    Location
    mckinney, texas
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question cut row based on cell value and paste in another worksheet

    I need to cut an entire row in worksheet 1 "Sales Log" if column N contains "converted" and paste it in the next available row in worksheet 2 "converted". then i need it to delete the row in worksheet 1 so i don't have a blank row. i have managed to get it to cut a row and paste it in worksheet 2 by recording a new macro, but it keeps cutting the same row and pasting the same row on worksheet2 deleting what was previously there.

    how can i edit the macro to do what i need it to do?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: cut row based on cell value and paste in another worksheet

    Post your code and we can help you edit it.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-09-2010
    Location
    mckinney, texas
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: cut row based on cell value and paste in another worksheet

    Sub converted()
    '
    ' converted Macro
    ' Macro recorded 4/9/2010 by rmcn
    '
    ' Keyboard Shortcut: Ctrl+c
    '
    Range("N2").Select
    ActiveCell.FormulaR1C1 = "converted"
    Rows("2:2").Select
    Selection.Cut
    Sheets("Converted").Select
    Range("A2").Select
    Selection.Insert Shift:=xlDown
    End Sub

  4. #4
    Registered User
    Join Date
    03-31-2010
    Location
    Utah, America
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: cut row based on cell value and paste in another worksheet

    try this, it works for what i've done in the past

    Sub DeleteRowWithContents()
    last = Cells(Rows.Count, "(Put the letter of the column that this phrase will bere here in quotes)".End(xlUp).Row
    for i = Last to 1 Step -1 'this is if you are going all the way to the top of the book, if not you might want to change the to value
    If(Cells(I, "(letter of the Column)" = "converted" Then
    Cells(i, "A").EntireRow.Delete
    
    Next i
    
    End Sub

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: cut row based on cell value and paste in another worksheet

    Try this:
    Sub Converted()
    
        Range("N" & ActiveCell.Row) = "converted"
        Rows(ActiveCell.Row).Copy _
            Sheets("Converted").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
        Rows(ActiveCell.Row).Delete xlShiftUp
    
    End Sub
    It will put the active row on the CONVERTED sheet at the bottom in the next empty row. The cursor can be anywhere in the row.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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