G
Guest
Hi,
I'm wondering if anyone can help.
I'm writing code in VBA in Excel to copy only the data validation from a selected line in one workbook to a range in another workbook.
When i use my code it brings the error message: "Paste Special Method of range class failed"
My code is as below:
Windows(file2).Activate
Rows("3:3").Select
Selection.Copy
Windows(File).Activate
Range(Cells(1, 1), Cells(400, 13)).Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
I've looked in the Excel help, and this says that 'xlDataValidation' is not an option for PasteSpecial.
There must be a way to only paste the validation!
Any help would be appreciated.
Jarred.
I'm wondering if anyone can help.
I'm writing code in VBA in Excel to copy only the data validation from a selected line in one workbook to a range in another workbook.
When i use my code it brings the error message: "Paste Special Method of range class failed"
My code is as below:
Windows(file2).Activate
Rows("3:3").Select
Selection.Copy
Windows(File).Activate
Range(Cells(1, 1), Cells(400, 13)).Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
I've looked in the Excel help, and this says that 'xlDataValidation' is not an option for PasteSpecial.
There must be a way to only paste the validation!
Any help would be appreciated.
Jarred.