Ungrouping macro

I need a macro to ungroup large amounts of groups within groups. This is what I have made so far. The problem I am running into is that I can't seem to get it to follow any logic to end the Do loop other then the counter down below but if I do to many step throughs then it errors out the macro.  I can't seem to get myself to accept the error. How can I fix what I am doing wrong? Any help would be greatly appreciated.

Sub UngroupItall()

Dim GroupedShapes As Shape
Dim SelectedArea As ShapeRange
Dim Variable01 As Variant
Set SelectedArea = ActiveSelectionRange

For Each GroupedShapes In SelectedArea
    Do Until Variable01 = 100
    If GroupedShapes.Type = cdrGroupShape Then
        ab = ab + 1
    End If
Next GroupedShapes

End Sub

  • Why would you want a macro to do it. Ctrl+A to select all and then 'Ungroup all'.

    Any ways I can try to write a macro for you but you will have to allow me a day as I have not installed DRAW on my home machine.