Excel Message box, fields that are 0
Thanks for reply Miki,
I am getting "run-time error "1004": Application-defined or object-defined
error"
Jim
"Mike H" wrote:
slight change in case there is text in the range
Sub standard()
Dim MaxCol As Long, MyCol As Long, x As Long
MaxCols = ActiveSheet.Columns.Count
Do
MyCol = Val(InputBox("Enter column to scan"))
Loop Until MyCol <= MaxCols
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For x = 1 To lastrow
If IsNumeric(Cells(x, MyCol).Value) And _
Cells(x, MyCol).Value 0 Then
MsgBox "Pass Due in cell " & Cells(x, MyCol).Address
End If
Next
End Sub
Mike
"Mike H" wrote:
Hi,
Right click your sheet tab, view code and paste this in and run it. You are
prompted for a column number to scan
Sub standard()
Dim MaxCol As Long, MyCol As Long, x As Long
MaxCols = ActiveSheet.Columns.Count
Do
MyCol = Val(InputBox("Enter column to scan"))
Loop Until MyCol <= MaxCols
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For x = 1 To lastrow
If Cells(x, MyCol).Value 0 Then
MsgBox "Pass Due in cell " & Cells(x, MyCol).Address
End If
Next
End Sub
Mike
"Jimjai" wrote:
Hi,
I would like to create a macro button that loops thru a column, if any
values on that column is greater than 0 then pop the message saying "pass
due" Thanks
Jimmy
|