MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Autofill & max calculation problem


Posted by Bob on October 08, 2000 8:23 PM

I'm having a problem where I try to find a maximum value in a column with a macro and it doesn't work because most of the column has been autofilled. The macro I'm using returns the max value only of the numbers I manually entered. I've tried changing the format of the column to number format, but that doesn't work. Can anybody help me here? Here's the macro I'm using:

Public Sub NEXTNUM()
mx = Application.WorksheetFunction.Max(Range _("C6:C259"))
Range("C262").Value = mx + 1
End Sub

Thanks.


Posted by Ivan Moala on October 09, 2000 12:05 AM

The following worked for me ??
What data type is in this column ??

Ivan

Public Sub NEXTNUM()
mx = Application.WorksheetFunction.Max(Range("C6:C259"))
Range("C262").Value = mx + 1
End Sub