vasim
Member
Hi,
I am testing the below code through F8 option, however each time I reach on Workbooks.open the further code runs automatically (without pressing F8) and ends...
Any ideas....I want to go through F8 F8 to check in each of the workbook.
[pre]
[/pre]
I am testing the below code through F8 option, however each time I reach on Workbooks.open the further code runs automatically (without pressing F8) and ends...
Any ideas....I want to go through F8 F8 to check in each of the workbook.
[pre]
Code:
Sub update()
Dim myfolder, myfile As Variant
Dim rng, metarng As Range
Dim wsm, wsr As Worksheet
Dim awb, rwb As Workbook
Application.ScreenUpdating = False
Set wsm = Worksheets("Metadata")
Set wsr = Worksheets("data")
Set rng = wsr.Range("A1:A11")
Set awb = Workbooks("METADATA")
myfolder = "workaholixnewVOL3Reports"
For Each cell In rng
myfile = cell.Value
Set rwb = Workbooks.Open(filename:=myfolder & "" & "Name_" & myfile & ".xlsm")
rwb.Activate
rwb.Worksheets("Calc").Range("AJ:AR").Clear
awb.Worksheets("Metadata").Range("A1").CurrentRegion.Copy Sheets("Calc").Range("AJ1")
rwb.Save
rwb.Close
Next cell
Application.ScreenUpdating = True
End Sub