I
Ian Elliott
Thanks to all that have given help and that give in the
future!
I have a macro in a workbook that copies a worksheet from
another workbook into the macro running one (code at end
of this message).
When I run the macro, I get an error that says:
"A formula or sheet you want to move or copy contains the
name 'blah', which already exists on the destination
worksheet. Do you want to use this version of the name? To
use the name as defined in the destination sheet, click
Yes. To rename the range ..."...and so on...
I checked with Edit>Find for 'blah' but it can't find it
(in that worksheet or the whole workbook)-ergo, it doesn't
exist on the destination worksheet I think. I did check on
the copy worksheet, it does exist there.
Does anyone know why I am getting this error?
Thanks again.
For a = 1 To 10
Workbooks.Open FileName:=Path(a) & File(a),
UpdateLinks:=0
Worksheets(WorkSheetNameThere(a)).Select
Cells.Select
Selection.Copy
ThisWorkbook.Worksheets(WorkSheetNameHere(a)).Activate
Cells.Select
Selection.PasteSpecial Paste:=xlAll
Cells.Copy
Selection.PasteSpecial Paste:=xlValues
Workbooks(File(a)).Close savechanges:=False
Next a
future!
I have a macro in a workbook that copies a worksheet from
another workbook into the macro running one (code at end
of this message).
When I run the macro, I get an error that says:
"A formula or sheet you want to move or copy contains the
name 'blah', which already exists on the destination
worksheet. Do you want to use this version of the name? To
use the name as defined in the destination sheet, click
Yes. To rename the range ..."...and so on...
I checked with Edit>Find for 'blah' but it can't find it
(in that worksheet or the whole workbook)-ergo, it doesn't
exist on the destination worksheet I think. I did check on
the copy worksheet, it does exist there.
Does anyone know why I am getting this error?
Thanks again.
For a = 1 To 10
Workbooks.Open FileName:=Path(a) & File(a),
UpdateLinks:=0
Worksheets(WorkSheetNameThere(a)).Select
Cells.Select
Selection.Copy
ThisWorkbook.Worksheets(WorkSheetNameHere(a)).Activate
Cells.Select
Selection.PasteSpecial Paste:=xlAll
Cells.Copy
Selection.PasteSpecial Paste:=xlValues
Workbooks(File(a)).Close savechanges:=False
Next a