JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,532
- Office Version
- 365
- Platform
- Windows
I am working on a UDF that processes a large table of data. A small example might look something like this.
<tbody>
</tbody>The UDF is passed the table range
The UDF loops through the rows and columns until it completed the work or encounters an error.
In the table above, there is a missing value in AC26. The error occurs when iRow=3 and iCol=7. But these are relative to the first cell in the table. I would like to be able to calculate the actual cell address (AC26 or $AC$26) and show that in a MsgBox.
Can someone help me with the code I need to do that?
Thanks
R/C | W | X | Y | Z | AA | AB | AC | AD |
24 | $100 | 4.5 | A | Y | B33 | 3/22 | 250 | 2005 |
25 | $250 | 5.8 | C | N | X21 | 4/15 | 135 | 2011 |
26 | $75 | 1.5 | F | N | R03 | 3/29 | 1995 | |
27 | $110 | 6.0 | D | Y | G44 | 4/20 | 400 | 2015 |
<tbody>
</tbody>
Code:
=DoIt(W24:AD27)
Code:
Public Function DoIt(Table as range)
Dim iCol as Integer, iRow as Integer
For iRow = 1 to RowN
For iCol = 1 to ColN
. . . code processing table cells
Next iCol
Next iRow
End Function
Can someone help me with the code I need to do that?
Thanks