What I am trying to to achieve is the max value in all sheets in my workbook and gather them in an specific sheet My vba code is working for one specific cell and when I have tried to add for loops Nothing happen and my excel would be not respond and freeze I will be thankful if any one could help.
Dim wsDst As Worksheet
Dim ws As Worksheet
Dim x As Long
Dim lngMax As Long
Set wsDst = Sheets("Summary")
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> wsDst.Name And ws.Name <> "Amirhossein" Then
For ZZ = 4 To 9999
For Q = 25 To 9999
With ws
x = Application.WorksheetFunction.max(.Cells(ZZ, 26))
If x > lngMax Then
wsDst.Cells(Q, 10).Value = x
lngMax = wsDst.Cells(Q, 10).Value
End If
End With
Next Q
Next ZZ
End If
Next ws