Z
ZX210
The attached excel document has an array of numbers of which I want to
associate max values with a week number. To do this I used the Max
function to set a range of cells using max values for their particular
weeks. Then I used a macro to find the max value and associate it with
its week. I used the find function to search for the max value where
the string being searched for is gstrfind which is equal to
Range("S2"), used the mValue=offset(rowuse,0).value where row use is a
negative number to find the week number. I then set a cell on the
worksheet equal to myValue which should be the week number.
If I type in the exact number being searched for into gstrfind then the
macro works, but as I will not know what the max value is to assign to
the variable this will not work. Please assist as to how I can
associate the Max value and the search variable. Thanks.
Attached:
HELP.xls
(File is clean of any malicious macros.)
Attachment filename: help.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=419437
associate max values with a week number. To do this I used the Max
function to set a range of cells using max values for their particular
weeks. Then I used a macro to find the max value and associate it with
its week. I used the find function to search for the max value where
the string being searched for is gstrfind which is equal to
Range("S2"), used the mValue=offset(rowuse,0).value where row use is a
negative number to find the week number. I then set a cell on the
worksheet equal to myValue which should be the week number.
If I type in the exact number being searched for into gstrfind then the
macro works, but as I will not know what the max value is to assign to
the variable this will not work. Please assist as to how I can
associate the Max value and the search variable. Thanks.
Attached:
HELP.xls
(File is clean of any malicious macros.)
Attachment filename: help.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=419437