max of a range every set amount

  • Thread starter Thread starter cynthia.derama
  • Start date Start date
C

cynthia.derama

Hello!

I have to create a macro to get the max of a set range of 24 cells
repeating throughout the spread sheet. i'm not familiar with the
syntax of vb for excel. does anyone have any suggestions?
 
Possibly

Sub sheetLoop()
Dim Count As Integer
Dim I As Integer
Count = ActiveWorkbook.Worksheets.Count
Dim maximum(100) As Long
For I = 1 To Count
maximum(I) =
WorksheetFunction.Max(ActiveWorkbook.Worksheets(I).Range("A1:A24"))
MsgBox ActiveWorkbook.Worksheets(I).Name & " Max value = " & maximum(I)
Next I
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top