limmontreefree
asked on
how loop over a range in Excel VBA
Hello I need to create a function in Excel using VBA.
I need to pass a range to loop it and perform some calculations.
The idea is use a for next bucle to read all the rows, and analice the diferente columns in it.
The problem is that I don't know how to reference the cells to read it.
Any idea?
At the moment I have this...
Function rangeAnalizer(num As Integer, fecha As Date, rango As Range)
Dim intNumFilas As Integer
Dim intNumColumnas As Integer
Dim celda As Range.Cells
intNumFilas = rango.Rows.Count
intNumColumnas = rango.Columns.Count
Dim prueba As Integer
prueba = celda(1, 1).Item ?????
I need to pass a range to loop it and perform some calculations.
The idea is use a for next bucle to read all the rows, and analice the diferente columns in it.
The problem is that I don't know how to reference the cells to read it.
Any idea?
At the moment I have this...
Function rangeAnalizer(num As Integer, fecha As Date, rango As Range)
Dim intNumFilas As Integer
Dim intNumColumnas As Integer
Dim celda As Range.Cells
intNumFilas = rango.Rows.Count
intNumColumnas = rango.Columns.Count
Dim prueba As Integer
prueba = celda(1, 1).Item ?????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I wish you the best for the new year.