S
sau
I would like to find the max value in a specific range of multi-worksheets in
a workbook.
I try to select the range of mult-worksheets but I am not able to get the
max value for below coding, please advise me what's the problem and how to
fix it.
Thank you
Sub macro()
Dim wks As Worksheet
For Each wks In Worksheets
wks.Select
wks.Range("A1:A10").Select
Next wks
activeCell.select = multiRange
Dim myRange As Range
Set myRange = multiRange
answer = Application.WorksheetFunction.Max(myRange)
Range("f2").Select
ActiveCell.Value = answer
End sub
a workbook.
I try to select the range of mult-worksheets but I am not able to get the
max value for below coding, please advise me what's the problem and how to
fix it.
Thank you
Sub macro()
Dim wks As Worksheet
For Each wks In Worksheets
wks.Select
wks.Range("A1:A10").Select
Next wks
activeCell.select = multiRange
Dim myRange As Range
Set myRange = multiRange
answer = Application.WorksheetFunction.Max(myRange)
Range("f2").Select
ActiveCell.Value = answer
End sub