Link to home
Start Free TrialLog in
Avatar of hindersaliva
hindersalivaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel 2013 shape height change display mystery

I'm trying to understand this. I have a shape that I want to animate its height growing. Like this

Sub ShapeHeightAnimation()

    Dim Total As Double

    ActiveSheet.Shapes("Rectangle 1").Height = 0
        
    For i = 1 To 100
        ActiveSheet.Shapes("Rectangle 1").Height = i
        
        'slow down
        For iRow = 1 To 8000
            Total = Total + Sheet2.Cells(iRow, 1).Value / 1000
        Next iRow        
    Next i

End Sub

Open in new window


BUT, the shape does not change height during the For-Next loop, but it updates the display only when the code has finished running. (Note the 'slow down')
I tried Application.ScreenUpdating = True but had no effect.

My simple animation test should work, right?
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial