A macro I am trying to build essentially tells excel to:
- Select an item from a drop-down, which changes the value of another cell
- Then copy and paste that value onto another sheet
- Move down to the next item on the drop-down
- Repeat
I used the below code which worked. However, I am also using Bloomberg to pull data when I select a new item on the drop-down. It takes a few seconds to pull the data. Right now the code doesn't "wait" for Bloomberg to pull the data before pasting the value. Therefore, my question is, how do I incorporate a code that tells excel to essentially wait 20 seconds or so every time a new item is selected from the drop-down before commencing the next step.
Sub DebtAutopull()
Dim dvCell As Range
Dim inputRange As Range
Dim c As Range
Dim i As Long
Set dvCell = Worksheets("PULLER").Range("B2")
Set inputRange = Evaluate(dvCell.Validation.Formula1)
i = 1
Application.ScreenUpdating = False
For Each c In inputRange
dvCell = c.Value
Worksheets("PASTE").Cells(i, "E").Value = Worksheets("PULLER").Range("D2").Value
i = i + 1
Next c
Application.ScreenUpdating = True
End Sub