Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Data Validation | Excel Programming | |||
Data Validation - copy/paste | Excel Programming | |||
Data Validation - copy paste ! | Excel Worksheet Functions | |||
data validation and copy/paste....... | Excel Programming | |||
Excel2000: How to copy data validation using VBA | Excel Programming |