Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
For Each
Hello,
In a comumn are 580 numbers and they change every day. By clicking the button in my worksheet I want the numbers who are different from zero ans use the following code. For one reason or another this won't work. As a control a have included a counter at the end to see if the code goes all the way to the end. Any ideas. Thanks Arwes Private Sub CommandButton2_Click() Dim myRange As Range Dim intCounter As Integer intCounter = 0 Range("AA5").Select Set myRange = Range("Y5:Y584") For Each cell In myRange.Cells If cell < "0" Then Debug.Print cell.Value End If intTeller = intTeller + 1 Next cell MsgBox intCounter End Sub |