View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Jim May
 
Posts: n/a
Default Function to find the address of a cell

Ron:
I set up both Screens side-by-side - Spreadsheet and VBE
On the original Code (Macro) I placed the Breakpoint next to the End
Function Line
On the spreadsheet Cell A1 (where =MinCellAddr(A2:A8) is the content I did an
Edit (F2) and re-entered it. AS I did the Cursor jumped to Cell A2, as
expected.
I then reset the Breakpoint up one line (that is, to the beginning of the
multiline code using the continuing (space/underscore). Then on Cell A1
again - Edit (F2) and the same code line code just set turned YELLOW
(indicating of course that it is the next line To BE RUN..) Placing my
cursor over the variable MinNum in the line before and also in the current
line --tooltip showed 2 (my correct minimum #).

In Cell G10 I entered =ISNUMBER(A2) and copied down 6 rows - ALL displayed
TRUE -- The values in A2:A8 are all numbers - constants (I think this is
proper
termonology)

In cell H4 if I enter =MIN(A2:A8) - 2 displays (Which is correct))

Wow, what else is there (to do)?
Appreciate your assistance,
Jim



"Ron Rosenfeld" wrote:

On Fri, 9 Dec 2005 07:34:03 -0800, "Jim May"
wrote:

Ron:
Thanks so much for the explanation. I tried everything you recommended,
(even the expanded code - This time on my AT-WORK PC - Orig is on my Home
PC);But all without success. Looks like time to
"we'll have to debug the code on your machine, to see
where it's going wrong" << I even (already) set the Breakpoints as you
suggest <<before End Function, but get no unusual results.
Hummmmm....
Tks,
Jim


When you write "get no unusual results" do you mean that the code stopped at
each breakpoint, or not?

If it did stop at each breakpoint, after this line:

MinNum = Application.WorksheetFunction.Min(rg)

has been executed (in other words, when the code has stopped on the following
line), float your cursor over the MinNum and see what the value is.

If it says MinNum=0, then the problem is that the values in rg are text.

If you manually entered those values, then possibly the cells were formatted as
text before you entered your values (and changing the format will not change
this).

If the contents are the result of a formula, then we should look at the
formula.

If the contents were imported from an html document, web page, or some other
database, then we should determine what, exactly, is in there so as to clean it
up in the simplest fashion.


--ron