Hello
I have a workbook with a list of ISO-codes (from A2 till A138)
De cell A2 is selected.
In the vba code I ask to open a template run the auto open macro (get data - save as and close this file)
and then in the initial file I want to delete row 2 and repeat the actions until we are at the end of the list.
But the vba stops when the template did the save as and close the file.
What do I have to do to continue the vba in the initial file ?
Thanks for helping !
this is the VBA in the initial file :
Sub Scorecalculation2()
Dim ThisWkbkNm As String
ThisWkbkNm = ActiveWorkbook.Name
' Select cell A2, *first line of data*.
Range("A2").Select
' Set Do loop to stop when an empty cell is reached.
Do Until IsEmpty(ActiveCell)
ChDir "M:\RM\Country Risk\Data\MacroFiches\CRAM templates and critical values"
Workbooks.Open Filename:= _
"M:\RM\Country Risk\Data\MacroFiches\CRAM templates and critical values\RISK_score_OECD - CRAM_PROTOTYPEtest.xlsm" _
, UpdateLinks:=3
Workbooks(ThisWkbkNm).Activate
Rows(2).EntireRow.Delete
Loop
End Sub
This is the list in the initial file :
I have a workbook with a list of ISO-codes (from A2 till A138)
De cell A2 is selected.
In the vba code I ask to open a template run the auto open macro (get data - save as and close this file)
and then in the initial file I want to delete row 2 and repeat the actions until we are at the end of the list.
But the vba stops when the template did the save as and close the file.
What do I have to do to continue the vba in the initial file ?
Thanks for helping !
this is the VBA in the initial file :
Sub Scorecalculation2()
Dim ThisWkbkNm As String
ThisWkbkNm = ActiveWorkbook.Name
' Select cell A2, *first line of data*.
Range("A2").Select
' Set Do loop to stop when an empty cell is reached.
Do Until IsEmpty(ActiveCell)
ChDir "M:\RM\Country Risk\Data\MacroFiches\CRAM templates and critical values"
Workbooks.Open Filename:= _
"M:\RM\Country Risk\Data\MacroFiches\CRAM templates and critical values\RISK_score_OECD - CRAM_PROTOTYPEtest.xlsm" _
, UpdateLinks:=3
Workbooks(ThisWkbkNm).Activate
Rows(2).EntireRow.Delete
Loop
End Sub
This is the list in the initial file :