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
keep your original file sagely somewhere so that is there is a mess up you can retrieve the data
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 |