I am trying to use the following line of code to obtain the highest value in column L and keep getting an error. Tried using "worksheetfunction", "application.worksheetfunction", etc.![]()
newHHNumber = Application.Max(Range("L2:L" & LastRow)) + 1
I am trying to use the following line of code to obtain the highest value in column L and keep getting an error. Tried using "worksheetfunction", "application.worksheetfunction", etc.![]()
newHHNumber = Application.Max(Range("L2:L" & LastRow)) + 1
Last edited by maacmaac; 01-03-2012 at 09:32 PM.
This shoudl do it - edit as required
![]()
Option Explicit Sub jiuk_TEST_myMAX_FUNCTION() Dim myAnswer_MAX As Long myAnswer_MAX = WorksheetFunction.Max(Range("l1:l5000")) MsgBox myAnswer_MAX theEND_jiuk_TEST_myMAX_FUNCTION: '// jiuk - do something N/A Exit Sub End Sub
Hi,
Which error are you getting? Do you have any error values in that range?
Good luck.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks