Wait until in a Loop

davide turchi 1 Reputation point
2020-08-05T18:03:09.887+00:00

Hi everyone,

I have a problem with a For Loop. What I have to do is this:

  1. Copy the first cell of ColumnA in F2 (in the yellow highlighted cell).
  2. Then all the data have to refresh.
  3. Then the cell F3 is update.
  4. The cell F3 is paste in B1 (the relative cell on the right of the columnA cell copy in the first step).

15826-immagine.png

Here is the code:

For x = 1 To 5

    Cells(x, 1).Select  
    Selection.Copy  
    Range("F2").Select  
    ActiveSheet.Paste  

HERE THERE MUST BE A FUNCTION THAT PERMIT TO WAIT UNTIL THE REFRESH

    Range("F3").Select  
    Selection.Copy  
    Cells(x, 2).Select  
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _  
        :=False, Transpose:=True  

Next

So the problem is that the loop copy and paste "#VALUE!" and doesn't wait the calculation.

I hope someone can help me.

Davide

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-08-06T02:07:01.26+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Currently, Microsoft Q&A supports the products listed over here: supported topics (more to be added later on).

    Your question about using VBA is not supported yet now. You could ask about this in Excel for Developers.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.