ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PasteSpecial problem (https://www.excelbanter.com/excel-programming/281515-re-pastespecial-problem.html)

Dave Peterson[_3_]

PasteSpecial problem
 
I recorded a macro in xl2002 and got this back:

xlPasteValidation

And from the immediate window:

?xldatavalidation
<<empty here
?xlpastevalidation
6



Sachin wrote:

Hi,

I am working on Excel 2000 on Win 2K Prof.
The need is to paste the 'Validation' from one column to
another at run time.
Obviously, what I do is 'Record a macro' and manually
do 'copy' from the source cell and 'pastespecial'
with 'validation' on the target cell and it is done.

Code that comes up is :
Range("A1").Select
Selection.Copy
Range("A6").Select
Selection.PasteSpecial Paste:=xlDataValidation,
Operation:=xlNone, _SkipBlanks:=False, Transpose:=False

Now, when I try to run this code dynamically it gives an
error saying 'PasteSpecial method of Range class failed -
error 1004'.

Any clues ?????

Many Thanks,
Sachin


--

Dave Peterson


Jim Rech

PasteSpecial problem
 
The problem being that xlPasteValidation isn't defined in Excel 2000.

--
Jim Rech
Excel MVP



Dave Peterson[_3_]

PasteSpecial problem
 
I thought it might have been that xl2k recorded it incorrectly:

xlDataValidation
instead of
xlpastevalidation

(don't have xl2k to check)

Jim Rech wrote:

The problem being that xlPasteValidation isn't defined in Excel 2000.

--
Jim Rech
Excel MVP


--

Dave Peterson



All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com