Link to home
Start Free TrialLog in
Avatar of limmontreefree
limmontreefreeFlag for Spain

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 ?????
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of limmontreefree

ASKER

Thank you very much, very helpful and very fast....

I wish you the best for the new year.