LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"