PC Review


Reply
Thread Tools Rate Thread

Data Validation won't copy

 
 
CLR
Guest
Posts: n/a
 
      18th Feb 2010
Hi All......
XL2k, I record the following macro and it does fine, then when I try to run
it, it stalls on the Pastespecial line.......whut's up please?

Sub Macro2()
Range("E1").Select
Application.CutCopyMode = False
Selection.Copy
Range("E12").Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub

Vaya con Dios,
Chuck, CABGx3


 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      18th Feb 2010
This work in XL2007, using xlPasteValidation, not xlDataValidation.

Sub Macro2()
Range("E1").Copy
Range("E15").PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub

Regards,
Per

"CLR" <(E-Mail Removed)> skrev i meddelelsen
news35A4530-B245-42AE-942D-(E-Mail Removed)...
> Hi All......
> XL2k, I record the following macro and it does fine, then when I try to
> run
> it, it stalls on the Pastespecial line.......whut's up please?
>
> Sub Macro2()
> Range("E1").Select
> Application.CutCopyMode = False
> Selection.Copy
> Range("E12").Select
> Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
> SkipBlanks:=False, Transpose:=False
> End Sub
>
> Vaya con Dios,
> Chuck, CABGx3
>
>

 
Reply With Quote
 
EricG
Guest
Posts: n/a
 
      18th Feb 2010
I don't know why it recorded "xlDataValidation". It should be
"xlPasteValidation".

If you put "Option Explicit" at the top of your code module, it would tell
you that it doesn't know what "xlDataValidation" is.

HTH,

Eric

"CLR" wrote:

> Hi All......
> XL2k, I record the following macro and it does fine, then when I try to run
> it, it stalls on the Pastespecial line.......whut's up please?
>
> Sub Macro2()
> Range("E1").Select
> Application.CutCopyMode = False
> Selection.Copy
> Range("E12").Select
> Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
> SkipBlanks:=False, Transpose:=False
> End Sub
>
> Vaya con Dios,
> Chuck, CABGx3
>
>

 
Reply With Quote
 
CLR
Guest
Posts: n/a
 
      18th Feb 2010
Thanks EricG, but no joy here........it does the same thing.....crashes on
that line.

Vaya con Dios,
Chuck, CABGx3
"EricG" wrote:




> I don't know why it recorded "xlDataValidation". It should be
> "xlPasteValidation".
>
> If you put "Option Explicit" at the top of your code module, it would tell
> you that it doesn't know what "xlDataValidation" is.
>
> HTH,
>
> Eric
>
> "CLR" wrote:
>
> > Hi All......
> > XL2k, I record the following macro and it does fine, then when I try to run
> > it, it stalls on the Pastespecial line.......whut's up please?
> >
> > Sub Macro2()
> > Range("E1").Select
> > Application.CutCopyMode = False
> > Selection.Copy
> > Range("E12").Select
> > Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
> > SkipBlanks:=False, Transpose:=False
> > End Sub
> >
> > Vaya con Dios,
> > Chuck, CABGx3
> >
> >

 
Reply With Quote
 
CLR
Guest
Posts: n/a
 
      18th Feb 2010
Thanks anyway Per, but still no joy. Your code works fine in xl2007, but I
need it to work in xl2000 and it still crashes there.

Vaya con Dios,
Chuck, CABGx3




"Per Jessen" wrote:

> This work in XL2007, using xlPasteValidation, not xlDataValidation.
>
> Sub Macro2()
> Range("E1").Copy
> Range("E15").PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
> SkipBlanks:=False, Transpose:=False
> Application.CutCopyMode = False
> End Sub
>
> Regards,
> Per
>
> "CLR" <(E-Mail Removed)> skrev i meddelelsen
> news35A4530-B245-42AE-942D-(E-Mail Removed)...
> > Hi All......
> > XL2k, I record the following macro and it does fine, then when I try to
> > run
> > it, it stalls on the Pastespecial line.......whut's up please?
> >
> > Sub Macro2()
> > Range("E1").Select
> > Application.CutCopyMode = False
> > Selection.Copy
> > Range("E12").Select
> > Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
> > SkipBlanks:=False, Transpose:=False
> > End Sub
> >
> > Vaya con Dios,
> > Chuck, CABGx3
> >
> >

> .
>

 
Reply With Quote
 
CLR
Guest
Posts: n/a
 
      18th Feb 2010
Thanks joel, but still no joy........still does the same thing, crashing on
the pastespecial line

Vaya con Dios,
Chuck, CABGx3



"joel" wrote:

>
> If the cell has validation data you must clear the old validattion
> before adding new validation. Something like this
>
> Range("E12").Validation.Delete
>
>
> --
> joel
> ------------------------------------------------------------------------
> joel's Profile: 229
> View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=180405
>
> Microsoft Office Help
>
> .
>

 
Reply With Quote
 
CLR
Guest
Posts: n/a
 
      18th Feb 2010
Hi All.......

I'm fortunate enough to have Excel 97, 2000, XP, 2003, and 2007 all on this
computer because this company has about 1000 computers and folks use all the
versions so I want to be sure my code will run in whatever version each user
has.

So, I checked my "Validation" problem on all the versions and it don't work
on 97 and 2000, but works fine as you would expect on XP, 2003, and
2007......so maybe this is just one of those things that can't be done in
XL2000.......maybe I'll just have to hard-code it in each time.


Vaya con Dios,
Chuck, CABGx3




"CLR" wrote:

> Hi All......
> XL2k, I record the following macro and it does fine, then when I try to run
> it, it stalls on the Pastespecial line.......whut's up please?
>
> Sub Macro2()
> Range("E1").Select
> Application.CutCopyMode = False
> Selection.Copy
> Range("E12").Select
> Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
> SkipBlanks:=False, Transpose:=False
> End Sub
>
> Vaya con Dios,
> Chuck, CABGx3
>
>

 
Reply With Quote
 
CLR
Guest
Posts: n/a
 
      18th Feb 2010
Thanks for your interest joel, but I just finished hard-coding the Validation
in, because I need the functon to work in xl2000 and the "Pastespecial" model
don't seem to work there. I thought it would be difficult to find the cells
I wanted to Validate, but in my search for a way to do the "Pastespecial
way", I discovered things that helped with the hard-coding and made it a snap.

I appreciate everyone's help
Vaya con Dios,
Chuck, CABGx3





"joel" wrote:

>
> Try doing it manually from the worksheet. Sometimes the error message
> are better..
>
>
> --
> joel
> ------------------------------------------------------------------------
> joel's Profile: 229
> View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=180405
>
> Microsoft Office Help
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Data Validation CLR Microsoft Excel Programming 0 16th Feb 2010 08:20 PM
Data Validation copy and paste bug Ryan W. Microsoft Excel Discussion 1 25th Aug 2008 10:28 PM
data validation and copy/paste....... =?Utf-8?B?TVBS?= Microsoft Excel Programming 3 27th Jul 2006 03:02 PM
Copy Data validation =?Utf-8?B?QUs=?= Microsoft Excel Misc 2 12th Oct 2004 04:03 PM
Excel2000: How to copy data validation using VBA Arvi Laanemets Microsoft Excel Programming 1 13th Jul 2004 12:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:39 AM.