next
02-26-2008, 08:45 AM
Option Explicit
Public x As Range
Public agesumCWI As Worksheet, agesumCLS As Worksheet
Sub Test2()
Set agesumCWI = Workbooks("agesum.dif").Worksheets("Cleanway")
Set agesumCLS = Workbooks("agesum.dif").Worksheets("Licensing")
With agesumCWI
LastCell = .Range("B1").End(xlDown).Row
For Each x In Columns(13)
'exit if last cell is passed
If x.Value = 0 Then
x.EntireRow.Delete Shift:=xlUp
ElseIf x.Row > LastCell Then Exit For
'fill blank cells with "NET 30" value
If IsEmpty(x.Value) Then x.Value = "NET 30"
End If
Next x
End With
End Sub
This line is returning an error "Type Mismatch" for some reason:
If x.Value = 0 Then
The only thing that i'm trying to do is: if a cell value is 0 then delete entire row.
Public x As Range
Public agesumCWI As Worksheet, agesumCLS As Worksheet
Sub Test2()
Set agesumCWI = Workbooks("agesum.dif").Worksheets("Cleanway")
Set agesumCLS = Workbooks("agesum.dif").Worksheets("Licensing")
With agesumCWI
LastCell = .Range("B1").End(xlDown).Row
For Each x In Columns(13)
'exit if last cell is passed
If x.Value = 0 Then
x.EntireRow.Delete Shift:=xlUp
ElseIf x.Row > LastCell Then Exit For
'fill blank cells with "NET 30" value
If IsEmpty(x.Value) Then x.Value = "NET 30"
End If
Next x
End With
End Sub
This line is returning an error "Type Mismatch" for some reason:
If x.Value = 0 Then
The only thing that i'm trying to do is: if a cell value is 0 then delete entire row.