SO I have a macro that i am using to create a specific report for my users to show them the values that are being used to calculate a value based on their input to the workbook. The macro first checks to see if the worksheet laborreport is present and if so deleted the current version of that work sheet. It then seletcs another sheet and clears the contents. of a range of cells, Seletcs the next worksheet( labor -final) and copies a range of cells to the OE2 worksheet. It then copies the worksheet OE2 to a new worksheet and names it laborreport.
Finally i Want it to check column H Cell 3 thru 400 and if the value = 0 delete the row. Everything works except the deletion of the row.. teh macro does complete and does not give me an error message
here is the Macro:
Sub laborreport()
Sheets("Main").Select
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each Sheet In ActiveWorkbook.Worksheets
If Sheet.Name = "laborreport" Then
Application.DisplayAlerts = False
Worksheets("laborreport").Delete
Application.DisplayAlerts = True
End If
Next Sheet
Sheets("OE2").Range("A4:F400").clearcontents
Sheets("Labor -Final").Range("A9:F369").Copy
ActiveWorkbook.Sheets("OE2").Range("A3").PasteSpecial Paste:=xlValues
Sheets("oe2").Copy after:=Sheets("summary")
ActiveSheet.Name = "laborreport"
With Sheets("laborreport")
BeginRow = 3
Endrow = 400
ChkCol = 8
For RowCnt = BeginRow To Endrow
If Cells(RowCnt, ChkCol).Value < 0.001 Then
Cells(RowCnt, ChkCol).EntireRow.Delete
End If
Next RowCnt
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Sheets("laborreport").Select
Range("a1").Select
End Sub
Finally i Want it to check column H Cell 3 thru 400 and if the value = 0 delete the row. Everything works except the deletion of the row.. teh macro does complete and does not give me an error message
here is the Macro:
Sub laborreport()
Sheets("Main").Select
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each Sheet In ActiveWorkbook.Worksheets
If Sheet.Name = "laborreport" Then
Application.DisplayAlerts = False
Worksheets("laborreport").Delete
Application.DisplayAlerts = True
End If
Next Sheet
Sheets("OE2").Range("A4:F400").clearcontents
Sheets("Labor -Final").Range("A9:F369").Copy
ActiveWorkbook.Sheets("OE2").Range("A3").PasteSpecial Paste:=xlValues
Sheets("oe2").Copy after:=Sheets("summary")
ActiveSheet.Name = "laborreport"
With Sheets("laborreport")
BeginRow = 3
Endrow = 400
ChkCol = 8
For RowCnt = BeginRow To Endrow
If Cells(RowCnt, ChkCol).Value < 0.001 Then
Cells(RowCnt, ChkCol).EntireRow.Delete
End If
Next RowCnt
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Sheets("laborreport").Select
Range("a1").Select
End Sub