+ Reply to Thread
Results 1 to 6 of 6

Refresh/Update Shapes while running macro

  1. #1
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Refresh/Update Shapes while running macro

    Hello Everyone,
    I was making a sort of animation of a moving triangle in excel. For the same I was able to make this (check attached)-

    This is the macro I am using-

    HTML Code: 
    The only problem is that this macro doesn't update the coordinates of the shape.
    In detail, the macro puts a value in cell B1 from 1 to 50. For every value a new set of coordinates are obtained in A4 to F4. I want the macro to plot a triangle with each of those 50 coordinates obtained, and delete the previous triangle, so that it creates a sort of animation of a moving triangle. But the macro doesn't refresh the shape with new coordinates and I end up having the last triangle i.e. 50th triangle.

    Please help me!!!!

    I just need something to refresh the shapes each time new coordinates are obtained.
    Do ask if anything seems to be confusing.

    Thank You so much in advance!!
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Refresh/Update Shapes while running macro

    DoEvents will allow the shape to be refreshed.
    You will also need something to delay the speed with which the loop executes otherwise the animation will be too quick

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Refresh/Update Shapes while running macro

    Thank you so much!!!!!!!!
    This was exactly what I was looking for!!!!

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Refresh/Update Shapes while running macro

    Hello again Sir,

    I tried executing the code provided by you in my actual project but it doesn't seem to work there.

    Please Login or Register  to view this content.
    (Check Module 2- Sub Revolve)
    This was the code provided by you which worked perfectly in the case of the triangle, but its not working here. Only the last coordinates are plotted and no sort of animation is done here.
    I tried increasing the time of sleep so that tasks could be completed in that time but in vein.

    I am successful in calculating all the coordinates and just need assistance for "Sleep and Do events part".

    I will be extremely grateful to you if you could once again assist me it accomplishing this.

    Thanks a lot again!!!!
    Attached Files Attached Files

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Refresh/Update Shapes while running macro

    Double up on the Doevents command

    Please Login or Register  to view this content.
    Even then the cube only move partially, but you can see it moving

  6. #6
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Refresh/Update Shapes while running macro

    That was all I needed!!!!!!

    Again thanks a tonne!!!!!!!!
    I really appreciate your assistance!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. screen flapping (charts, shapes,graphs...etc) while macro is running
    By wellous in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2014, 12:23 PM
  2. Macro to auto update data range and refresh pivot table does not work
    By aikido1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2014, 05:59 AM
  3. Progress indicator or countdown timer while refresh macro is running
    By DanGres in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2014, 09:21 PM
  4. Macro to refresh pivot table and update data source
    By TBO in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2013, 01:09 PM
  5. Enable Auto Refresh - Wait for refresh to sinish before running a macro
    By tomlancaster in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2011, 11:52 AM
  6. Running macro with No Update Window
    By krayziez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2008, 12:18 AM
  7. running a macro on every refresh of the screen
    By shovit sahai in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-02-2005, 10:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1