+ Reply to Thread
Results 1 to 2 of 2

VBA Macro Help -- Cut/Paste EntireRow with Multiple Conditions

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    Washington, D.C.
    MS-Off Ver
    Excel 2003
    Posts
    2

    VBA Macro Help -- Cut/Paste EntireRow with Multiple Conditions

    I am working with the VBA Macro below -- with this macro I have been searching all rows containing text="Baltimore" and then cut/paste onto different sheets. In addition to this, I need to sort both text="Baltimore" with a condition of "Y" or "N". I have attached the file, any help would be appeciated! I have spent the last few hours trying to figure this out and I keep getting errors.


    If "Baltimore" + "Y" condition is met, I need to cut/paste the entire row into the first empty row available under 'Current Account - Yes'
    If "Baltimore" + "N" condition is met, I need to cut/paste the entire row into the fitst empty row available under 'Current Account - No'

    Current Macro:

    Sub List()
    Dim xrow As Long
    xrow = 4
    Sheets("Low Market Share Accounts").Select
    Dim lastrow As Long
    lastrow = Cells(Rows.Count, 1).End(xlUp).Row

    Do Until xrow = lastrow + 1
    ActiveSheet.Cells(xrow, 6).Select
    If ActiveCell.Text = "Baltimore" Then
    Selection.EntireRow.Copy
    Sheets("Targets Baltimore").Select
    ActiveSheet.Range("LastCellBaltimore").Select
    ActiveSheet.Paste
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
    Sheets("Low Market Share Accounts").Select
    End If

    xrow = xrow + 1
    Loop
    End Sub

    TESTFILE.xls

  2. #2
    Registered User
    Join Date
    11-16-2012
    Location
    Washington, D.C.
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: VBA Macro Help -- Cut/Paste EntireRow with Multiple Conditions

    This has been solved.

+ 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