close

Sub Macro1()
'去除不要資料列
my_rows = Sheets(1).UsedRange.Rows.Count
'For i = 3 To my_rows
For i = my_rows To 2 Step -1
'If ((Cells(i, 10).Value <> "") and ((Cells(i, 9).Value-Cells(i, 10).Value)/Cells(i, 9).Value))<0.1)) Then
'my_low = (Cells(i, 9).Value - Cells(i, 10).Value) / Cells(i, 9).Value
If Cells(i, 8).Value < 0 Or Cells(i, 10).Value < 0 Or Cells(i, 9).Value = "建材營造業" Then
Debug.Print "@@@" & Cells(i, 8).Value & "***" & my_rows & "***"
Rows(i).Delete Shift:=xlUp '刪除後指標往上移一列
End If
Debug.Print "@@@" & i & "***" & my_rows & "***"
Next i
ActiveWorkbook.Save
End Sub

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 gniksong 的頭像
    gniksong

    有機小松的部落格

    gniksong 發表在 痞客邦 留言(0) 人氣()