Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA - Max Function - Syntax Error
I cannot find the proper syntax for this Max Function
Assume the current Row# is 20. I want to populate H20 with the Max(I20,M20,O20) I have an Error whether I reverse the order of Columns-Rows reference or not, but I am still in learning mode. Dim LastRow As Long, ShNextRow As Long, Fcst As Long With ActiveSheet For ShNextRow = 10 To LastRow Fcst = WorksheetFunction.Max(Range("I" & ShNextRow, "M" & ShNextRow, "O" & ShNextRow)) .Range("H" & ShNextRow) = Fcst Next ShNextRow End With Your help will be appreciated, Wayne |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel VBA - Max Function - Syntax Error
Hi Wayne,
Fcst = WorksheetFunction.Max(Cells(ShNextRow, "I"), _ Cells(ShNextRow, "M"), Cells(ShNextRow, "O")) Regards, OssieMac "u473" wrote: I cannot find the proper syntax for this Max Function Assume the current Row# is 20. I want to populate H20 with the Max(I20,M20,O20) I have an Error whether I reverse the order of Columns-Rows reference or not, but I am still in learning mode. Dim LastRow As Long, ShNextRow As Long, Fcst As Long With ActiveSheet For ShNextRow = 10 To LastRow Fcst = WorksheetFunction.Max(Range("I" & ShNextRow, "M" & ShNextRow, "O" & ShNextRow)) .Range("H" & ShNextRow) = Fcst Next ShNextRow End With Your help will be appreciated, Wayne |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
COUNTA function causing syntax error in macro... | Excel Worksheet Functions | |||
Excel VB - WHERE syntax error in Access web query. | Excel Programming | |||
Excel 2007 MS Query prompt yields Syntax error | Excel Discussion (Misc queries) | |||
MS Query import from Excel - Syntax Error | Excel Discussion (Misc queries) | |||
Syntax Error in Excel Query for DATE field | Excel Discussion (Misc queries) |