I want to execute a For/Next Loop for all the Rows in a column.
For rwindex = 1 to (Number of Rows in the column)
How do I get a count of the number of rows in the column for the above statement. If the criteria are met in the for statement I want that row deleted and the subsequent empty row edited out of the column. I want a continuous column of data in the end that does not meet any of the criteria in the For/Next statement - any cells that did meet the criteria are deleted from the column.
Thanks for your help.
I tried what follows but can't get the number of the last row of the column containing data. How do I find the value of intRows?
For rwIndex = 1 To intRows
For colIndex = 1 To 1
Dim MyVal
With Worksheets("Sheet1").Cells(rwIndex, colIndex)
MyVal = Worksheets("Sheet1").Cells(rwIndex, colIndex)
If .Value < 1 Or IsNumeric(MyVal) = False Then .Value = 0
End With
Next colIndex
Next rwIndex
For rwindex = 1 to (Number of Rows in the column)
How do I get a count of the number of rows in the column for the above statement. If the criteria are met in the for statement I want that row deleted and the subsequent empty row edited out of the column. I want a continuous column of data in the end that does not meet any of the criteria in the For/Next statement - any cells that did meet the criteria are deleted from the column.
Thanks for your help.
I tried what follows but can't get the number of the last row of the column containing data. How do I find the value of intRows?
For rwIndex = 1 To intRows
For colIndex = 1 To 1
Dim MyVal
With Worksheets("Sheet1").Cells(rwIndex, colIndex)
MyVal = Worksheets("Sheet1").Cells(rwIndex, colIndex)
If .Value < 1 Or IsNumeric(MyVal) = False Then .Value = 0
End With
Next colIndex
Next rwIndex