Search : in
By :

Macro to find Min value

Last answer on Oct 1, 2009 2:09:29 am BST JV, on Sep 30, 2009 2:57:50 pm BST 
 Report this message to moderators

Hello,
I need code for part of my macro that will find the min value in a particular column and based on the min value clear the contents in other cells.

For example, I have dates in one column such as:

200906
200905
200808
200801
200710
200705
200702

So I need to find all the cells with the min date and clear the contents of other cells for the min value only.

Thanks
Jay

Configuration: Windows XP Internet Explorer 6.0

Best answers for « Macro to find Min value » in :
VB6 Finding the RGB values of a color Show VB6 Finding the RGB values of a color Dim R as integer Dim G as integer Dim B as integer Sub FindRGB(Col As Long) R = &HFF& And Col G = (&HFF00& And Col ) \ 256 B = (&HFF0000 And Col ) \ 65536 End Sub Note: Here...
Excel – Macro for copy & paste selected range ShowExcel – Macro for copy & paste selected range Issue Solution Note Issue I have a summary of data by month in one sheet and the raw data in another sheet. Instead of creating multiple worksheets for my raw data for each month, I want...
Manipulating Excel comments ShowManipulating Excel comments Associating an explanatory comment to a cell Customizing the format of this comment Associating an explanatory comment to a cell Put your cursor on cell you want to comment. Right-click the cell, then...
Firefox - Finding the profile folder ShowFirefox - Finding the profile folder Windows 9x/Me : C:\Windows\Application Data\Mozilla\Firefox\Profiles\< Profile Name >\ or C:\Windows\Profiles\\Application Data\Mozilla\Firefox\Profiles\< Profile Name...
Download Advanced Find&Replace for Excel ShowDescription This application is designed by Add-in Express LTD. Advanced Find & Replace is an add-on for Microsoft Excel. It allows you to run multiple searches for values, formulas and comments. The search results are displayed in a floating...
Download LBE Find & Replace for MS Outlook ShowDescription The application is designed by Leigh Business Enterprises Ltd. LBE Find & Replace for MS Outlook is a tool that allows you to search and replace missing text in your contacts, emails, appointments and many more. Simple and easy to use,...

1

 venkat1926, on Oct 1, 2009 2:09:29 am BST

keep your original file sagely somewhere so that is there is a mess up you can retrieve the data

try this macro

Sub test()
Dim rng As Range, mn As Long, j As Integer, k As Integer
Set rng = Range(Range("A1"), Range("A1").End(xlDown))
mn = WorksheetFunction.Min(rng)
j = Range("A1").End(xlDown).Row
MsgBox mn
MsgBox j
For k = j To 1 Step -1
If Cells(k, 1) <> mn Then Cells(k, 1).EntireRow.Delete
Next k

End Sub



if this is ok confirm in the post

Reply to venkat1926