Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to get min value from a column using VBA


Hi friends

I have a Column containing number. Everyday I add one value to this
column.
(say todays there are 20 rows than tomm. I will add one value and will
make 21 rows). I want to display the minimum value from these values.
How to do this using *VBA*?

Thanks in advance
:) JohnBest:)


--
johnbest
------------------------------------------------------------------------
johnbest's Profile: http://www.excelforum.com/member.php...o&userid=29694
View this thread: http://www.excelforum.com/showthread...hreadid=497224

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default how to get min value from a column using VBA

No need for VBA. Just create a named formula that automatically
adjusts to new data. Given your data in column A, I will assume row 1
is a header.

Then, use Insert | Name Define... and create a name such as BaseData.
In the 'refers to' enter

=OFFSET('Basic Range'!$A$2,0,0,COUNTA('Basic Range'!$A:$A)-1,1)
where 'Basic Range' is the name of your worksheet.

Now, you can use =MIN(BaseData) wherever you want and the formula will
adjust itself as you add data to column A.

For some other applications see
Dynamic Charts
http://www.tushar-mehta.com/excel/ne...rts/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...

Hi friends

I have a Column containing number. Everyday I add one value to this
column.
(say todays there are 20 rows than tomm. I will add one value and will
make 21 rows). I want to display the minimum value from these values.
How to do this using *VBA*?

Thanks in advance
:) JohnBest:)


--
johnbest
------------------------------------------------------------------------
johnbest's Profile:
http://www.excelforum.com/member.php...o&userid=29694
View this thread: http://www.excelforum.com/showthread...hreadid=497224


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default how to get min value from a column using VBA

If you don't have anything else in that column, you could just use:

=min(a:a)
as a worksheet formula.

In code, you could use:

msgbox application.min(activeworkbook.worksheets("sheet1" ).range("a:a"))



johnbest wrote:

Hi friends

I have a Column containing number. Everyday I add one value to this
column.
(say todays there are 20 rows than tomm. I will add one value and will
make 21 rows). I want to display the minimum value from these values.
How to do this using *VBA*?

Thanks in advance
:) JohnBest:)

--
johnbest
------------------------------------------------------------------------
johnbest's Profile: http://www.excelforum.com/member.php...o&userid=29694
View this thread: http://www.excelforum.com/showthread...hreadid=497224


--

Dave Peterson
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
divide column(x) by column(y) to give column(x/y) in excel? James New Users to Excel 2 April 24th 23 11:46 AM
Calculating column A * column B = Results in another column jhun Excel Worksheet Functions 2 March 30th 10 05:13 AM
Referencing date column A & time column B to get info from column TVGuy29 Excel Discussion (Misc queries) 1 January 24th 08 09:50 PM
Return text in Column A if Column B and Column K match jeannie v Excel Worksheet Functions 4 December 13th 07 07:36 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM


All times are GMT +1. The time now is 01:36 PM.

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

About Us

"It's about Microsoft Excel"