Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Data Validation won't copy

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Data Validation won't copy

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" skrev i meddelelsen
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Data Validation won't copy

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data Validation won't copy


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

  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Data Validation won't copy

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




  #6   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Data Validation won't copy

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" skrev i meddelelsen
...
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


.

  #7   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Data Validation won't copy

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

.

  #8   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Data Validation won't copy

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


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data Validation won't copy


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

  #10   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Data Validation won't copy

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Data Validation CLR Excel Programming 0 February 16th 10 08:20 PM
Data Validation - copy/paste Ken Valenti Excel Programming 3 June 18th 09 05:49 PM
Data Validation - copy paste ! Christoffer Bloch Andersen Excel Worksheet Functions 1 March 18th 09 01:22 PM
data validation and copy/paste....... MPR Excel Programming 3 July 27th 06 03:02 PM
Excel2000: How to copy data validation using VBA Arvi Laanemets Excel Programming 1 July 13th 04 12:32 PM


All times are GMT +1. The time now is 04:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"