Hi...pretty new to all this.
I have a macro that opens up another workbook "CurveWorkBook", and copies values from there into the original workbook "Template".
The problem is that "CurveWorkBook" is huge. It has a number of macros on it and if used manually takes at least one hit of F9 and about a 3 to 4 second wait each time until everything runs, calculates and displays the values that I want to copy and paste into "Template".
If I run through my macro step by step using F8 it seems to work fine. So I thought the solution must be to try and make the macro wait while "CurveWorkBook" opens and does it's thing, before carrying on with the task. But I still the values dont seem to have time to update.
Anyone know what code I can use to open "CurveWorkBook", F9 it (at least once) and make sure that everything waits until it has had time to draw all it's data in and calculate it, before the macro continues? Will paste the relevant part of the code I have below. As you can see, Im trying a few different things!
Thanks a lot
Workbooks.Open (ThisWorkbook.Path & "\Pricing Sheets" & "\" & DataWorkbookName)
For Each ws In ThisWorkbook.Worksheets
ws.Calculate
Next ws
Answer = MsgBox("Give it 5 secs or so...", vbOKCancel, "Wait punk!")
Application.Calculate
Worksheets(1).Calculate
Range(DataArea).Select
Selection.Copy
I have a macro that opens up another workbook "CurveWorkBook", and copies values from there into the original workbook "Template".
The problem is that "CurveWorkBook" is huge. It has a number of macros on it and if used manually takes at least one hit of F9 and about a 3 to 4 second wait each time until everything runs, calculates and displays the values that I want to copy and paste into "Template".
If I run through my macro step by step using F8 it seems to work fine. So I thought the solution must be to try and make the macro wait while "CurveWorkBook" opens and does it's thing, before carrying on with the task. But I still the values dont seem to have time to update.
Anyone know what code I can use to open "CurveWorkBook", F9 it (at least once) and make sure that everything waits until it has had time to draw all it's data in and calculate it, before the macro continues? Will paste the relevant part of the code I have below. As you can see, Im trying a few different things!
Thanks a lot
Workbooks.Open (ThisWorkbook.Path & "\Pricing Sheets" & "\" & DataWorkbookName)
For Each ws In ThisWorkbook.Worksheets
ws.Calculate
Next ws
Answer = MsgBox("Give it 5 secs or so...", vbOKCancel, "Wait punk!")
Application.Calculate
Worksheets(1).Calculate
Range(DataArea).Select
Selection.Copy