Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Excel2000: How to copy data validation using VBA

Hi

How doesn't the code from below work? I get Run-time error '1004':
PasteSpecial method of Range class failed!

....
Sheets("SheetName").Range("A1:D1").Offset(RowNo - 2, 0).Copy
Sheets("SheetName").Range("A1:D1").Offset(RowNo - 1, 0).PasteSpecial _
Paste:=xlDataValidation, Operation:=xlNone, SkipBlanks:=False,
Transpose:=False
....

It does work with xlPasteFormats
Sheets("SheetName").Range("A1:D1").Offset(RowNo - 1, 0).PasteSpecial _
Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False,
Transpose:=False

I'm writing an Open event for workbook, which when needed adds new records
into table, and copies some data valdation lists from existing rows into new
ones.


Thanks in advance for any help

--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Excel2000: How to copy data validation using VBA

Solved (found a hint from web)!


Sheets("SheetName").Range("A1:D1").Offset(RowNo - 1, 0).PasteSpecial _
Paste:=xlDataValidation, Operation:=xlNone, SkipBlanks:=False,
Transpose:=False



Sheets("SheetName").Range("A1:D1").Offset(RowNo - 1, 0).PasteSpecial _
Paste:=6, Operation:=xlNone, SkipBlanks:=False, Transpose:=False



--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)


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
Excel2000: Data validation behaving funny Arvi Laanemets Excel Discussion (Misc queries) 4 March 31st 06 07:08 PM
In EXCEL2000, How can I copy a file and make it usable in MS WORK TampaDog Excel Discussion (Misc queries) 1 September 15th 05 02:02 PM
Excel2000: Data Validation to restrict entries Arvi Laanemets Excel Discussion (Misc queries) 0 February 22nd 05 08:17 AM
Excel2000: Custom data validation and named ranges Arvi Laanemets Excel Discussion (Misc queries) 9 December 10th 04 07:05 PM
Excel2000: Copy all exept data Arvi Laanemets Excel Programming 1 May 11th 04 03:31 PM


All times are GMT +1. The time now is 06:15 PM.

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"