Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specialpaste method Range failed error

Status
Not open for further replies.

JazzBeatles

Technical User
Dec 11, 2006
14
US
Hi, people seem to run across this problem a lot and I've never seen a clear cut answer. What am I doing wrong in this code? I just need it to ensure that every cell has data validation since datavalidation cells can easily be copied over and lose their dv dropdown. Thanks in advance for any help rendered.



Code:
Range("B298:B299").Copy

With Range("B68:B118")

        .PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _

        SkipBlanks:=False, Transpose:=False

    End With

 

[b]'that doesn't work, or this next one[/b]

 

Range("B298:B299").Copy

     Range("B68:B118").PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _

        SkipBlanks:=False, Transpose:=False

 

[b]'or even this[/b]

 

Range("B298:B299").Copy

     Range("B68:B118").Select

     Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _

        SkipBlanks:=False, Transpose:=False
 


hi,

Code:
        .PasteSpecial Paste:=[b]xlPasteValidation[/b], Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Haven't tried it just yet--but this should copy all the data validation state from the copied cells into the destination cells? Thanks again--I'll give it a shot when I get to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top