Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
MIN/MAX question
How do you write a min/max formula in VB?
Within a macro I'm trying to get the minimum of two numbers. I tried the following and got an error: END = MIN(BEGROW +10, MAXROW) Where BEGROW and MAXROW are calclutaed within the macro. thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
MIN/MAX question
worksheetfunction.max(BEGROW+10,MAXROW)
-- HTH RP "Mike" wrote in message ... How do you write a min/max formula in VB? Within a macro I'm trying to get the minimum of two numbers. I tried the following and got an error: END = MIN(BEGROW +10, MAXROW) Where BEGROW and MAXROW are calclutaed within the macro. thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
MIN/MAX question
Thank you so much!
-----Original Message----- worksheetfunction.max(BEGROW+10,MAXROW) -- HTH RP "Mike" wrote in message ... How do you write a min/max formula in VB? Within a macro I'm trying to get the minimum of two numbers. I tried the following and got an error: END = MIN(BEGROW +10, MAXROW) Where BEGROW and MAXROW are calclutaed within the macro. thanks . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
MIN/MAX question
Function MyMin(A, B)
if A < B then MyMin = A else MyMin = B End if End Function You can add error checking and so forth. -- Regards, Tom Ogilvy "Mike" wrote in message ... How do you write a min/max formula in VB? Within a macro I'm trying to get the minimum of two numbers. I tried the following and got an error: END = MIN(BEGROW +10, MAXROW) Where BEGROW and MAXROW are calclutaed within the macro. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 Macro/VB Question DDE Question | Excel Worksheet Functions | |||
Question about Sum | Excel Worksheet Functions | |||
where can I see my question and answer? Yesterday I ask a question | Excel Discussion (Misc queries) | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions |