Hello all!
I have a Range object which I set as follows ('namedRange' is a named range of cells in the spreadsheet):
Set myRange = Range("namedRange").Resize(numRows, numCols)
Using a loop, I would like to pass to a function each row, with all the columns in that row, for all the rows in the range.
This code, which I tried, does not work:
This code just passes an increasing amount of rows to the function, rather than just a single row for each iteration of the For loop.
Help, please :-0 !
I have a Range object which I set as follows ('namedRange' is a named range of cells in the spreadsheet):
Set myRange = Range("namedRange").Resize(numRows, numCols)
Using a loop, I would like to pass to a function each row, with all the columns in that row, for all the rows in the range.
This code, which I tried, does not work:
Code:
Dim lngRowCount as Long
Dim lngCtr as Long
lngRowCount = Range("namedRange").Rows.Count
For lngCtr = 1 to lngRowCount
Range("namedRange").Resize(lngCtr,Range("namedRange").Columns.Count)
myFunction Range("namedRange")
Next lngCtr
This code just passes an increasing amount of rows to the function, rather than just a single row for each iteration of the For loop.
Help, please :-0 !