Consulting

Results 1 to 2 of 2

Thread: Solved: If values in row cut/paste

  1. #1
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location

    Solved: If values in row cut/paste

    I have data on a sheet that gets updated daily.
    What I need is to be able to have the user click the command button on the sheet and have it cut the rows that have values in Columns E & F
    And paste them in the Sheets("Completed").

    Then move the rows remaining up.

    Any help would be great.

  2. #2
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    I was able to locate this code that works with worksheet_change

    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    'Change in Column G
    If Target.Column <> 7 Then Exit Sub
    If Target.Value > 0 Then
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    Dim myrow As Long
    myrow = Target.Row
    Target.EntireRow.Cut
    Sheets("Completed").Range("A65536").End(xlUp).Offset(1, 0).Insert 'shift:=xlDown
    Sheets("Sheet1").Range("A" & myrow).EntireRow.Delete
    Application.ScreenUpdating = True
    Application.EnableEvents = True
    End If
    End Sub[/vba]

    This does what I was looking for.
    Hope this can help someone

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •