View Single Post
 
Old 05-10-2018, 05:01 AM
Shashi Kant Shashi Kant is offline Windows 7 32bit Office 2016
Novice
 
Join Date: May 2018
Posts: 16
Shashi Kant is on a distinguished road
Default Query Ansered

Code:
Private Sub CommandButton1_Click()
    Dim ws As Worksheet
    Dim i As Integer
    For Each ws In Worksheets
        ws.Select
        For i = 1 To ws.Cells(Rows.Count, "Y").End(xlUp).Row
            If ws.Cells(i, "Y").Value = "G" And ws.Cells(i, "Z") > 1 Then
                ws.Range(ws.Cells(i - 1, "Y"), ws.Cells(i - 1, "Z")).Value = _
                ws.Range(ws.Cells(i, "Y"), ws.Cells(i, "Z")).Value
                ws.Cells(i, "Y").Select
                Selection.EntireRow.Delete Shift:=xlUp
            End If
        Next i
    Next ws
End Sub
Attached Files
File Type: xlsm Query.xlsm (28.0 KB, 11 views)

Last edited by Pecoflyer; 05-12-2018 at 12:15 AM. Reason: Added code tags
Reply With Quote