View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
[email protected] wfgfreedom@gmail.com is offline
external usenet poster
 
Posts: 28
Default Loop through table of columns and rows

On Jan 20, 5:08*pm, FSt1 wrote:
hi
your code is full of syntax errors. What are you trying to do?
I'm guessing search range F35 to R54 for negative numbers?

regards
FSt1



" wrote:
Iam trying to create a loop that searches through a table of columns
and rows to zero and negative values. *My columns portion of the code
is causing an error. *How should I change the code to have it work
properly.


Sub Search()
LastColumn = "R"
NewColumnCount = "F"
For ColumnCount = NewColumnCount To LastColumn
LastRow = 54
NewRowCount = 38
For RowCount = NewRowCount To LastRow
* *If Range(ColumnCount & RowCount) < 0 Then
* * * Range(ColumnCount & RowCount) = 0
* * * NewRowCount = NewRowCount + 2
* *End If
Next RowCount
NewColumnCount = NewColumnCount + 2
Next ColumnCount
End Sub


Frank- Hide quoted text -


- Show quoted text -


I realize my code has errors, since I am a novice, and need help. I am
trying to search through a table from F38 through R54 and zero any
value that is below zero. I need to search only through every send
row, of every second column through this table.

Frank