Kod:
Sub GCDx()
Dim Max As Integer
Dim x As Integer
Dim GCD As Integer
Dim GCDTemp As Integer
Dim Cell As Object
Dim Rng As String
Rng = "A1:D1"
Max = Application.WorksheetFunction.Max(Range(Rng))
For x = 1 To Int(Max / 2) + 1
For Each Cell In Range(Rng)
If Cell.Value Mod x = 0 Then
GCDTemp = x
Else
GCDTemp = 0
Exit For
End If
Next
GCD = Application.WorksheetFunction.Max(GCD, GCDTemp)
Next
MsgBox (GCD)
End Sub