Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I want to define a constant in my macro to be the max value in column D from
row 2 to the last row. I'm sure this is an easy one but can't come up with the code. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry...didn't mean to post twice. I got an error message on the other one
that there was a connection error. "Steve" wrote: I want to define a constant in my macro to be the max value in column D from row 2 to the last row. I'm sure this is an easy one but can't come up with the code. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
MaxVal = WorksheetFunction.Max(Range("D2:D" & Cells(Rows.Count, "D").End(xlUp).Row)) Mike "Steve" wrote: I want to define a constant in my macro to be the max value in column D from row 2 to the last row. I'm sure this is an easy one but can't come up with the code. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yes!
"Mike H" ... Hi, MaxVal = WorksheetFunction.Max(Range("D2:D" & Cells(Rows.Count, "D").End(xlUp).Row)) Mike "Steve" wrote: I want to define a constant in my macro to be the max value in column D from row 2 to the last row. I'm sure this is an easy one but can't come up with the code. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Define a range | Excel Discussion (Misc queries) | |||
Index to define a range | Excel Worksheet Functions | |||
Define a range of cells in VBA | Excel Discussion (Misc queries) | |||
Macro - define cell range for a sum function | Excel Discussion (Misc queries) | |||
Define a range based on another named range | Excel Worksheet Functions |