Re: Run Macro For Specific Workbook In Background
hi tgit,
welcome to Ozgrid.com.
try specifying the target file and the sheetname before pasting the values
hope this helps
[QUOTE=tgit]
Code
Sub Macro6()
'Macro to insert row
Windows("YourTargetFile.xls").Activate'make target file active (file must be open)
Sheets("Sheet3").Select 'specify the target sheet
Rows("4:4").Select
Selection.Insert Shift:=xlDown
Rows("3:3").Select
Selection.Copy
Rows("4:4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Call the initial Macro to restart the loop
Call Macro3
End Sub
Display More
QUOTE]