Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Question about Sum Keith Excel Worksheet Functions 2 August 18th 09 06:09 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"